How does this work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
7th Sep 2020, 9:16 AM
Abhay
Abhay - avatar
8 Answers
+ 3
My english isnt good enough to explain it, but check this one out http://blog.vjeux.com/2010/javascript/javascript-max_int-number-limits.html
7th Sep 2020, 9:52 AM
Rei
Rei - avatar
+ 3
Divya Mohan its rounding problem. Js store Number in floating point, check the article i linked
7th Sep 2020, 9:57 AM
Rei
Rei - avatar
+ 2
Just check this Var b = 9007199254740993 Console.log(b); It still print 9007199254740992 I think it's a bug of sololearn with such a big number
7th Sep 2020, 9:54 AM
Divya Mohan
Divya Mohan - avatar
+ 2
Divya Mohan it's not a bug the maximum safe integer is 900719925470992 ,but logging out 900719925470992+2 works unlike +1
7th Sep 2020, 9:56 AM
Abhay
Abhay - avatar
+ 1
Are you taking about Math.pow() ??
7th Sep 2020, 9:50 AM
Divya Mohan
Divya Mohan - avatar
+ 1
Divya Mohan check the output for these two lines console.log(x); console.log(x+1);
7th Sep 2020, 9:50 AM
Abhay
Abhay - avatar
+ 1
Ooo Thanks Rei I learn something new here. And sorry to sololearn 🙏😊 I think I might also be due to sololearn.
7th Sep 2020, 10:00 AM
Divya Mohan
Divya Mohan - avatar
+ 1
Rei thanks a lot ,I didn't understand all of that ,those significant and exponents but it does have an explanation about what I wanted to know
7th Sep 2020, 10:17 AM
Abhay
Abhay - avatar