Why javascript 18014398501093363 == 18014398501093364 returns true
迷茫
迷茫 2017-06-26 10:55:29
0
3
637

As the title, as shown in the picture

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(3)
学霸

In fact, sgf has an article that explains it in detail/a/11...; I also expanded the safe calculation range by the way, get!

世界只因有你

I tested it, 1801439850109336 == 1801439850109335 output is false, 18014398501093363 == 18014398501093364 is indeed true. So it should be that js can compare numbers with up to 16 digits, and any extra 16 digits will be rounded off at the end. If you must compare large numbers, you can convert the numbers into strings and determine whether the two strings are equal.

習慣沉默

Just found one

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template