-
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
(a) Why is there no need for StaticFloat32
or StaticInt32
?
(b) Why is StaticInt idempotency & etc. defined
StaticInt(N::Int) = StaticInt{N}()
StaticInt(N::Integer) = StaticInt(convert(Int, N))
StaticInt(::StaticInt{N}) where {N} = StaticInt{N}()
StaticInt(::Val{N}) where {N} = StaticInt{N}()
while StaticFloat64
idempotentcy & etc is defined
(::Type{T})(x::Integer) where {T<:StaticFloat64} = StaticFloat64(x)
(::Type{T})(x::AbstractFloat) where {T<:StaticFloat64} = StaticFloat64(x)
# this line added to prevent stack overflow: `StaticFloat64(static(1.0))`
(::Type{T})(::StaticFloat64{N}) where {N, T<:StaticFloat64} = StaticFloat64{N}()
# this line added to match handling of `StaticInt(::Val{N})`
(::Type{T})(::Val{N}) where {N, T<:StaticFloat64} = StaticFloat64{float(N)}()
Metadata
Metadata
Assignees
Labels
No labels