Create your blog and photo album with postbit
Create your blog and photo album

Create new post


Upload a picture:
Tags (keywords separated by comma)

Save Cancel
The JavaScript Blog js:   Followers: 5 ; Following: 3

Explore The JavaScript Blog's photo albums:
Photos from posts (7)
Javascript tools (2)

Online calculator with arbitrary precision

I've just created simple online calculator with arbitrary precision, so users can have many digital places. Here it is:
Currently it's very simple, only can only divide (x/y) and multiply (x*y) but it's useful to play with divisions. My initial goal was play with divisions that have interesting results in the decimal places expansion, like "1/9998"
JavaScript currently have precision of not many decimal places (20 decimal places), so the result would look just like this:
1/99998 = 0.00001000020000400008
(result from a simple online javascript calculator:
But with a large arbitrary precision decimal places, the result is much more impressive (80 decimal places in this case): 
1/99998 = 0.00001000020000400008000160003200064001280025600512010240204804096081921638432769
(result from the precision-calculator using bignumber.js or big.js JavaScript library created by Michael Mclaughlin)

One future idea for this js library would be to have a parser that could understand expressions like: 10.5 * (1/3+1/(2**16))
May be convert this to the bignumber API syntax and then eval the result.
Try also some interesting divisions, that will display incredible results in the decimal places expansion:
  1/99998 (will display powers of 2);
  1/99997 (will display powers of 3);
  1/998001 (will display sequential numbers);
  1001000/997002999 (will display all powers)


Post by The JavaScript Blog (2014-01-31 16:20)

Post your comment:

Name: Email: Site:

| Explore users | New posts | Create your blog | Create your photo album |
| About Postbit | Our blog | Terms of use | Contact Postbit |

Copyright © 2018 -