0

Why is 429221958243152700-429221958243152682 on Google search output 0? Does anyone know? Also, when I did a form post with javascript for the value "429221958243152682", I get 429221958243152700. What is wrong with the math?

JSNewbie
  • 31
  • 6
  • This number is above the maximum "safe" value for precision computations in JavaScript. Starting from a certain value, integer calculations in javascript are not exact. Check out https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER – Pac0 Sep 01 '20 at 17:48
  • see also https://stackoverflow.com/questions/588004/is-floating-point-math-broken . Note a comment on this question : all JavaScript numeric calculations uses "floating point double precision", subject to rounding errors, even with integers. – Pac0 Sep 01 '20 at 17:51

0 Answers0