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
Support BigInt? #75
Comments
https://observablehq.com/d/a990a01f65d4056f see also #73. |
I don’t think we can support BigInt yet—it’s still missing from Safari on both desktop and iOS. https://caniuse.com/#feat=bigint Also, it’s a little pointless to interpolate BigInts since you’re necessarily losing the arbitrary precision that BigInt gives you by converting to floats. If you want to interpolate BigInts, it probably makes more sense to convert to a Float64Array (or number) first. |
Yes. Exception is when you want the exact values at t=0 and t=1. Anyway it was a nice exercise :) |
We should fix the exact values at t={0,1} per #73 independent of the type. |
- interpolates typed arrays (Float64Array, etc) and standard arrays that contain only numbers with a simple for… loop. - autodetects both situations (we could optionally unplug the number array detection) - not compatible with BigInt typed arrays (#75)
d3.interpolate(BigInt(5), BigInt(15))(0.5)
throws a TypeError: Cannot convert a BigInt value to a numberBigInt64Array and BigUint64Array (typed arrays) could be supported too (see Interpolate typed array folded #74 (comment)).
The text was updated successfully, but these errors were encountered: