Naruyoko / OmegaNum.js

A huge number library holding up to 10{1000}9e15. A basement for planned {10,x,1,2}.
https://naruyoko.github.io/OmegaNum.js/index.html
MIT License
33 stars 15 forks source link

Add afford/cost geometric/arithmetic series functions. #19

Closed Reinhardt-C closed 5 years ago

Reinhardt-C commented 5 years ago

I added them because I needed them for my game ;)

Reinhardt-C commented 5 years ago

The new functions are pretty much exact copies of the ones in Patashu's Break_Eternity.js. I needed them for my game and noticed you didn't have them so I decided to add them. They are static functions, starting on line 524. Hopefully someone else will find this useful.

Reinhardt-C commented 5 years ago

Also, I noticed you have a function called standarlize... is that a misspelling of standardize? I didn't change it because it is probably used in numerous other places in the code...

Reinhardt-C commented 5 years ago

This next part should fix #18 without compromising accuracy, you can still have 9 decimal points of accuracy, just changed code for .div slightly to fixt rogue floating point decimals.

Reinhardt-C commented 5 years ago

Codacy says that what I did will cause floating point errors ironically... I'll make that better... :(

Reinhardt-C commented 5 years ago

Codacy still says the same thing... I'll leave it and you can fix it if necessary, even though this is javascript and there is at least 8 bits for exponents while my number uses 5...

Naruyoko commented 5 years ago

Sorry for a late reply. This seems pretty awesome!