-
Notifications
You must be signed in to change notification settings - Fork 7
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
Adapt polyfill to current state of decimal proposal? #16
Comments
Hello Jesse! It's great to hear from you. I see that you have something like: I vote for something much shorter, like |
@jessealama |
@jessealama , why do you use Decimal.cmp not Decimal.compare if you have long names for everything else |
@jessealama , I have done some changes, but there are still a lot of work if to support multiplyAndAdd, reminder, and numbers without normalization |
@jessealama , non-normalized decimals looks pretty natural, well. i have not tested all cases |
@jessealama I have run the tests from https://github.com/jessealama/decimal128/tree/main/tests/dectest against my code and fixed few bugs, I see some tests fails when the result is rounded to infinity or not rounded, not sure if it is a bug of test suite or my code's bug |
Awesome! Thanks for taking a look. Yes, supporting non-normalized values is a bit tricky. Is there anything you need some help with? I'd be happy to take a look at a PR, for instance. |
Those properties were intended to be private -- no need to worry about that! |
There's just |
Absolutely agree with it, filled the same ideas here tc39/proposal-decimal#105 |
not entirely true, support for non-normalized values according to the ІЕЕЕ754 standard seems quite natural, I didn’t even have to change the code, the only place is exact division: |
Jesse here, one of the co-champions of the decimal proposal! As I am preparing to give an update to the TC39 plenary, I noticed your polyfill. This looks great! There was a time when the champions were considering an arbitrary-precision model for decimals, but after a lot of discussion we've settled on a fixed bit-width approach, IEEE 754 Decimal128 in particular. Would you be interested in updating your polyfill to reflect those changes? FWIW I have an npm library that implements Decimal128 (or, more precisely, the part of Decimal128 that's relevant to the proposal as it currently stands).
The text was updated successfully, but these errors were encountered: