Skip to content
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

Details of BigDecimal64Array and BigDecimal128Array #16

Open
littledan opened this issue Nov 13, 2019 · 0 comments
Open

Details of BigDecimal64Array and BigDecimal128Array #16

littledan opened this issue Nov 13, 2019 · 0 comments

Comments

@littledan
Copy link
Member

BigInt established a pattern of working with TypedArrays and DataViews, to provide serialization for a fixed-size subset. This could be very useful for BigDecimal, where IEEE 754 decimal can provide a good interchange format. Both 64-bit and 128-bit seem to be in use, so I'd propose providing both.

There are two binary formats for IEEE 754 decimal (BID and DPD). Some platforms have hardware acceleration for one, or highly optimized libraries for the other, so I'd suggest we leave it implementation-determined what binary format is the "default", just like endianness in TypedArrays. We could have DataView methods which let you select one or the other.

Any thoughts about this outline? We could leave these arrays for "later" if we want to avoid touching IEEE 754 decimal, but it seems pretty useful to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant