V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
tamamaxox
V2EX  ›  问与答

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

  •  
  •   tamamaxox · 2014-12-22 11:44:07 +08:00 · 1882 次点击
    这是一个创建于 3385 天前的主题,其中的信息可能已经有所发展或是发生改变。
    求方案
    4 条回复    2014-12-22 19:37:30 +08:00
    kingwrcy
        1
    kingwrcy  
       2014-12-22 11:51:33 +08:00
    console.log('16320828211200033')

    要做数字运算就不行了
    hcymk2
        2
    hcymk2  
       2014-12-22 12:09:55 +08:00
    http://www.leemon.com/crypto/BigInt.js

    console.log(bigInt2str(str2bigInt("16320828211200033",10),10));
    这样写真是蛋疼...
    tamamaxox
        3
    tamamaxox  
    OP
       2014-12-22 19:36:26 +08:00
    @kingwrcy
    @hcymk2
    问题是为啥会这样?
    tamamaxox
        4
    tamamaxox  
    OP
       2014-12-22 19:37:30 +08:00
    @hcymk2
    这样写的话代码真心不想给人看
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2813 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 14:49 · PVG 22:49 · LAX 07:49 · JFK 10:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.