tc39 / proposal-decimal

Built-in decimal datatype in JavaScript
http://tc39.es/proposal-decimal/
446 stars 17 forks source link

June spec review #155

Open waldemarhorwat opened 3 weeks ago

waldemarhorwat commented 3 weeks ago

I took another look at the Decimal spec for the June meeting. The spec forms a good foundation, but I found some pervasive issues that make it self-contradictory or produce incorrect results and should be addressed before seeking stage 2.

My review follows. Some of the items are nontrivial and will require some discussion and agreement on how to fix. I'm offering to provide whatever help is needed to understand and fix these.

Confusion

Rounding

Quantum Handling

Canonicalization

Comparisons

Conversions

ECMAScript Mechanics

Missing Operations

Structure

jessealama commented 3 weeks ago

Thanks for taking a look! I'll get to work on these issues. Stay tuned.

waldemarhorwat commented 3 weeks ago

I added a sketch of how to fix things.

jessealama commented 3 weeks ago

(This was unintentionally closed in #156 )

jessealama commented 3 weeks ago

Thanks so much for this second round of detailed review! We plan to make changes to address almost all of your points below. Specifically:

Type errors

Rounding

Quantum handling

Canonicalization

Comparisons

Conversions

ECMAScript mechanics

Missing operations

Structure

waldemarhorwat commented 3 weeks ago

Thank you!

Some comments:

waldemarhorwat commented 3 weeks ago

I added a proposed design of the methods for querying and working with exponents, significands, and the quantum, along with sample code for many use cases.