-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Decimal128 #1192
Add Decimal128 #1192
Conversation
b55fc9a
to
bd68e97
Compare
so pleased this is in motion @nielsenko , thank you soooo much! |
@dotjon0 I will need to postpone this work about a week, but then I'll return to it. I hope it is not inconvenient. Note that it is a fairly rudimentary implementation supporting just basic the arithmetic operations ( |
@nielsenko no need to apologise, we are just very grateful for this feature going in! Functionality sounds great. Thank you so much |
bd68e97
to
93c8480
Compare
93c8480
to
3a5dd42
Compare
8e8f061
to
e734cf8
Compare
Pull Request Test Coverage Report for Build 4991375873
💛 - Coveralls |
5251e23
to
0413522
Compare
b8a87d6
to
08cc103
Compare
dfb9a3a
to
86badfb
Compare
Assigning a sub-struct from a heap allocated struct to a stack allocated struct, does not actually copy the bytes. This is a work-around for that issue.
Add support for
Decimal128
. This behaves as you would expect from IEEE754, including behaviour of NaN comparison, ie.Nan == NaN
isfalse
. Note that you can still query for aNaN
value in the DB as realm-core treatsNaN
as any other (single) value, to have a total order.Be aware that the Dart
compareTo
method is implemented to honor the total ordering of IEEE754-2008 paragraf 5.10, which mimic the behaviour of Dartdouble
. Note that this means thatcompareTo
will order any values, including+/- NaN
,+/- Infinity
as well as+/- 0
. This implies thecompareTo
operation is different from the partial ordering given byoperator==
,operator<
, andoperator>
. For example, IEEE doubles impose thatDecimal128.zero == -Decimal128.zero
and all comparison operations on NaN return false.This function imposes a complete ordering for doubles. When using
compareTo
, the following properties hold:-Decimal128.zero
is less thanDecimal128.zero
(and the integer 0), but greater than any non-zero negative value.