bigdecimal.js | Javascript BigDecimal data type for arbitrary precision
kandi X-RAY | bigdecimal.js Summary
kandi X-RAY | bigdecimal.js Summary
Please see the Iris Couch official bigdecimal.js repository. Thank you.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bigdecimal.js
bigdecimal.js Key Features
bigdecimal.js Examples and Code Snippets
Community Discussions
Trending Discussions on bigdecimal.js
QUESTION
I'm porting a JavaScript game into C#, an interesting feature of this game is that there are dozens of resources which grow from fractions per second to over e^thousands per second.
I need to be able to do standard math operations / string formats on these numbers many times a second ... mostly addition as resources accumulate and division to show how many of x I can buy with y or how long it'll take to complete a goal given a per second progress.
In C# I've tried using various 3rd party large number solutions (Rational / BigDecimal / BigFloat) all of which use System.Numerics.BigInteger under the hood ... and I've tried just using BigIntegers. All of these are functional but suffer from unacceptable performance.
My use-case doesn't need arbitrarily large (expected practical range is +/- e5000) or precise (6 decimal places is comfortably enough) numbers but I do need simple math operations to be significantly faster than BigInteger will provide. What are potential solutions to this problem?
Edit 1 - the JS game uses BigDecimal.js ... which also has performance issues later game when the numbers get really large.
Edit 2 - For anyone down-voting I'd really appreciate an explanation why.
Edit 3 - rephrased as a single question / to be more on topic.
...ANSWER
Answered 2017-Aug-05 at 02:11Here is a library for quadruple floats (128 bits) with 64 bits of precision and a 64-bit exponent. I haven't used it, but it seems to be reasonably performant considering what you are trying to accomplish.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bigdecimal.js
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page