This question already has an answer here:
JavaScript parseInt is giving me wrong number, what I'm doing wrong?
                                
                                    (1个答案)
                                
                        
                4年前关闭。
            
        

为什么?


  parseInt((10152174800132377).toString(16),16)==
  10152174800132376


哪里丢了多少?

最佳答案

该数字丢失了,因为它很大,可以用JavaScript的Number类型精确表示(它是IEEE 754的double值):

$ node
> 10152174800132377
10152174800132376

关于javascript - ParseInt 16的基数到10的基数,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30438254/

10-10 05:16