tamamaxox
V2EX  ›  问与答

简单的 js bug 问题 console.log(16320828211200033) //16320828211200032

  •  
  •   tamamaxox · Dec 22, 2014 · 2492 views
    This topic created in 4208 days ago, the information mentioned may be changed or developed.
    求方案
    4 replies    2014-12-22 19:37:30 +08:00
    kingwrcy
        1
    kingwrcy  
       Dec 22, 2014
    console.log('16320828211200033')

    要做数字运算就不行了
    hcymk2
        2
    hcymk2  
       Dec 22, 2014
    http://www.leemon.com/crypto/BigInt.js

    console.log(bigInt2str(str2bigInt("16320828211200033",10),10));
    这样写真是蛋疼...
    tamamaxox
        3
    tamamaxox  
    OP
       Dec 22, 2014
    @kingwrcy
    @hcymk2
    问题是为啥会这样?
    tamamaxox
        4
    tamamaxox  
    OP
       Dec 22, 2014
    @hcymk2
    这样写的话代码真心不想给人看
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4081 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 00:57 · PVG 08:57 · LAX 17:57 · JFK 20:57
    ♥ Do have faith in what you're doing.