@@ -35,7 +35,7 @@ given integer type, you can define this overload for your integer type.
35
35
You will also need to implement some parts of the interface below, including _widen().
36
36
"""
37
37
ShouldUseCustomFldmodByConst (:: Type{<:Base.BitInteger} ) = true
38
- ShouldUseCustomFldmodByConst (:: Type{<:Union{Int256,Int128 }} ) = true
38
+ ShouldUseCustomFldmodByConst (:: Type{<:Union{Int256,UInt256 }} ) = true
39
39
ShouldUseCustomFldmodByConst (:: Type ) = false
40
40
41
41
@inline function fldmod_by_const (x, y)
@@ -130,10 +130,12 @@ end
130
130
131
131
# Annoyingly, Unsigned(T) isn't defined for BitIntegers types:
132
132
# 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.
133
137
_unsigned (x) = unsigned (x)
134
138
_unsigned (:: Type{Int256} ) = UInt256
135
139
_unsigned (:: Type{UInt256} ) = UInt256
136
- _unsigned (:: Type{Int128} ) = UInt128
137
- _unsigned (:: Type{UInt128} ) = UInt128
138
140
139
141
nbits (x) = sizeof (x) * 8
0 commit comments