Giter Club home page Giter Club logo

Comments (5)

Pomax avatar Pomax commented on May 30, 2024

Given that the max int value that JS can faithfully represent is 9007199254740991 (0x1FFFFFFFFFFFFF), that value is most certainly incorrect.

from bezierjs.

louisremi avatar louisremi commented on May 30, 2024

Ok, so should the code use 0x1FFFFFFFFFFFFF instead of 0xFFFFFFFFFFFFFFFF and 99999999?
I believe I've also seen bbox algorithms in js using +Infinity and -Infinity. This should work well.

from bezierjs.

Pomax avatar Pomax commented on May 30, 2024

I don't really like Infinity for the fact that it's not correct (Infinity === Infinity is true, which is absolute nonsense, mathmatically) so I'd much rather use Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER, probably cached as scoped vars so there's no need to do a lookup through the Number namespace beyond assignment.

from bezierjs.

louisremi avatar louisremi commented on May 30, 2024

Alright, let me know if you want me to do that PR or if you find it quicker to do it yourself.

from bezierjs.

Pomax avatar Pomax commented on May 30, 2024

PRs are always quicker than me adding it in unless I'm in a period of active maintenance, which for bezier.js I'm not =)

If you want to help, much appreciated!

from bezierjs.

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.