Is there a decimal math library for JavaScript?

后端 未结 3 2102
清酒与你
清酒与你 2020-11-27 06:31

Is there a mature library for doing decimal-based math, possibly arbitrary-precision, in JavaScript?

Edit: I want this information for a reference p

3条回答
  •  感情败类
    2020-11-27 06:58

    There's been a "port" of the Java BigDecimal class (I think it's here: http://freshmeat.net/projects/js_bigdecimal/ ) for a long time. I looked at it a long time ago and it seemed kind-of cumbersome and huge, but (if that's the one I'm thinking of) it's been used as part of some cryptography tools so there's a decent chance that it works OK.

    Because cryptography is a likely area to generate a need for such things, that's a good way to snoop around for such packages.

    edit: Thanks @Daniel (comment to question) for this older SO question: https://stackoverflow.com/questions/744099/javascript-bigdecimal-library

提交回复
热议问题