Skip to content

Commit c7a151a

Browse files
committed
Clarify the _unsigned(x) methods with comments
1 parent 3f39b8a commit c7a151a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/fldmod-by-const.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ end
130130

131131
# Annoyingly, Unsigned(T) isn't defined for BitIntegers types:
132132
# https://github.com/rfourquet/BitIntegers.jl/pull/2
133+
# Note: We do not need this for Int512, since we only widen to 512 _after_ calling
134+
# _unsigned, above. This code is only for supporting the built-in integer types, which only
135+
# go up to 128-bits (widened twice to 512). If a user wants to extend FixedDecimals for
136+
# other integer types, they will need to add methods to either _unsigned or unsigned.
133137
_unsigned(x) = unsigned(x)
134138
_unsigned(::Type{Int256}) = UInt256
135139
_unsigned(::Type{UInt256}) = UInt256
136-
_unsigned(::Type{Int128}) = UInt128
137-
_unsigned(::Type{UInt128}) = UInt128
138140

139141
nbits(x) = sizeof(x) * 8

0 commit comments

Comments
 (0)