-
Notifications
You must be signed in to change notification settings - Fork 18
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
Comparisons #116
Comments
Yes, I'd be happy to omit this function too. We might want to add a SameValue-like equality comparison operator (could be a separate name), but I'm not convinced about the need for this linear order either. |
Right, the current intention is to model IEEE 754's
It looks like I unintentionally switched things. We want to make it possible for programmers to think of Decimal objects as mathematical values (certainly for comparisons). It looks I accidentally swapped I'm happy to drop the more complicated comparison. But I'm not 100% on that. There may be some use cases where one needs to compare Decimals as digit strings, not mathematical values. Perhaps @sffc might know of a use case coming from the Intl world? |
Let's err on the minimal side, and take this operation out. We can consider re-adding it later if someone comes along and presents a strong argument for it. |
I would support doing something similar to what we did in Temporal where |
The current status is that we'll have a Temporal-style Apart from that, we'll have <, =, ≠, ≤, >, and ≥ which work with the (extended) mathematical value of their arguments. |
I can't find compare_total in my copy of IEEE 754, and, amazingly, a Google search returns nothing at all for IEEE 754 compare_total. Nor do I see it in the list of recent changes to IEEE 754. I assume this is referring to the totalOrder operation in the standard?
The total order predicate has technically challenging semantics and radically differs from how ==, ===, <, etc. behave on Numbers. Folks trying to use the total order version of < will experience serious surprises unless they're advanced numeric experts.
At the very least we should define the total order operation as a separately named function, rather than sticking it as a mode on comparisons. Preferably we should omit it altogether from the first version of Decimal. It would be odd to include an IEEE operation that's so obscure that we don't even provide it on Numbers. Providing Decimal exponentials and such should be a higher priority.
The text was updated successfully, but these errors were encountered: