Git Product home page Git Product logo

Comments (11)

paulmillr avatar paulmillr commented on May 22, 2024

Do you propose to round the result?

The function uses just built-in js math funcs: Math.log(1e15) * 1 / Math.LN10 gives the same result.

from es6-shim.

Yaffle avatar Yaffle commented on May 22, 2024

rounding will not help

users of this shim should be informed...

from es6-shim.

paulmillr avatar paulmillr commented on May 22, 2024

I've added accuracy is 1e-11 to the readme.

from es6-shim.

Yaffle avatar Yaffle commented on May 22, 2024

how did you calculate this accuracy?

from es6-shim.

paulmillr avatar paulmillr commented on May 22, 2024

It's simple, it's the smallest accuracy when all math tests are passing.

from es6-shim.

Yaffle avatar Yaffle commented on May 22, 2024

Math.hypot(10e200, 0) - 10e200

from es6-shim.

paulmillr avatar paulmillr commented on May 22, 2024

and this is a bug in hypot. it should be probably for large numbers

function(x, y) {
  return Math.sqrt(x) * Math.sqrt(x) + Math.sqrt(y) * Math.sqrt(y);
};

from es6-shim.

paulmillr avatar paulmillr commented on May 22, 2024

meh, it gives incorrect result too

from es6-shim.

Yaffle avatar Yaffle commented on May 22, 2024

@paulmillr see https://gist.github.com/2427837 for "hypot" - http://www.netlib.org/fdlibm/e_hypot.c translated to js

from es6-shim.

paulmillr avatar paulmillr commented on May 22, 2024

great, thanks, i'll look at it & try to merge

from es6-shim.

Yaffle avatar Yaffle commented on May 22, 2024

nice

from es6-shim.

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.