@@ -35,7 +35,7 @@ given integer type, you can define this overload for your integer type.
3535You will also need to implement some parts of the interface below, including _widen().
3636"""
3737ShouldUseCustomFldmodByConst (:: Type{<:Base.BitInteger} ) = true
38- ShouldUseCustomFldmodByConst (:: Type{<:Union{Int256,Int128 }} ) = true
38+ ShouldUseCustomFldmodByConst (:: Type{<:Union{Int256,UInt256 }} ) = true
3939ShouldUseCustomFldmodByConst (:: Type ) = false
4040
4141@inline function fldmod_by_const (x, y)
@@ -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
139141nbits (x) = sizeof (x) * 8
0 commit comments