Giter Site home page Giter Site logo

Support BigInt? about d3-interpolate HOT 4 CLOSED

d3 avatar d3 commented on May 4, 2024
Support BigInt?

from d3-interpolate.

Comments (4)

Fil avatar Fil commented on May 4, 2024

t === 1 ? B : A + BigInt(Math.round(t * Number(B - A))) seems to be working

https://observablehq.com/d/a990a01f65d4056f

see also #73.

from d3-interpolate.

mbostock avatar mbostock commented on May 4, 2024

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.

from d3-interpolate.

Fil avatar Fil commented on May 4, 2024

Yes. Exception is when you want the exact values at t=0 and t=1. Anyway it was a nice exercise :)

from d3-interpolate.

mbostock avatar mbostock commented on May 4, 2024

We should fix the exact values at t={0,1} per #73 independent of the type.

from d3-interpolate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.