-
Notifications
You must be signed in to change notification settings - Fork 32
Description
In theory, the number of fractional bits f can be countlessly large, but what is the actual upper limit?
I assumed that it is 8sizeof(T)-1 for Fixed{T}, and 8sizeof(T) for Normed{T}.
However, the larger numbers are also used actually.
FixedPointNumbers.jl/test/fixed.jl
Line 63 in 7ad0f0c
| for (TI, f) in [(Int8, 8), (Int16, 8), (Int16, 10), (Int32, 16)] |
FixedPointNumbers.jl/test/fixed.jl
Line 96 in 7ad0f0c
| F8 = Fixed{Int8,8} |
FixedPointNumbers.jl/test/fixed.jl
Line 110 in 7ad0f0c
| x = Fixed{Int8,8}(0.3) |
FixedPointNumbers.jl/test/fixed.jl
Line 138 in 7ad0f0c
| for T in (Fixed{Int8,8}, Fixed{Int16,8}, Fixed{Int16,10}, Fixed{Int32,16}) |
Perhaps some functions do not work properly with large f, due to implicit upper limits.
Edit:
I intend to support Fixed{T,f} where f == 8sizeof(T), i.e. throw no exceptions. However, they have no typealias and will not be tested enough.