@@ -150,15 +150,15 @@ function arrowtype(b, ::Type{Bool})
150
150
end
151
151
152
152
struct Decimal{P,S,T}
153
- value:: T # only Int128 or Int256
153
+ value:: T # only Int32, Int64, Int128 or Int256
154
154
end
155
155
156
156
Base. zero (:: Type{Decimal{P,S,T}} ) where {P,S,T} = Decimal {P,S,T} (T (0 ))
157
157
== (a:: Decimal{P,S,T} , b:: Decimal{P,S,T} ) where {P,S,T} = == (a. value, b. value)
158
158
Base. isequal (a:: Decimal{P,S,T} , b:: Decimal{P,S,T} ) where {P,S,T} = isequal (a. value, b. value)
159
159
160
160
function juliaeltype (f:: Meta.Field , x:: Meta.Decimal , convert)
161
- return Decimal{x. precision,x. scale,x. bitWidth == 256 ? Int256 : Int128}
161
+ return Decimal{x. precision, x. scale, x. bitWidth == 256 ? Int256 : x . bitWidth == 128 ? Int128 : x . bitWidth == 64 ? Int64 : Int32 }
162
162
end
163
163
164
164
ArrowTypes. ArrowKind (:: Type{<:Decimal} ) = PrimitiveKind ()
@@ -167,7 +167,7 @@ function arrowtype(b, ::Type{Decimal{P,S,T}}) where {P,S,T}
167
167
Meta. decimalStart (b)
168
168
Meta. decimalAddPrecision (b, Int32 (P))
169
169
Meta. decimalAddScale (b, Int32 (S))
170
- Meta. decimalAddBitWidth (b, Int32 (T == Int256 ? 256 : 128 ))
170
+ Meta. decimalAddBitWidth (b, Int32 (T == Int256 ? 256 : T == Int128 ? 128 : T == Int64 ? 64 : 32 ))
171
171
return Meta. Decimal, Meta. decimalEnd (b), nothing
172
172
end
173
173
0 commit comments