decimal maths

BlitzMax Forums/BlitzMax Programming/decimal maths

Chris C(Posted 2006) [#1]
where 0.2 = 0.2 and not 0.2000000001 !!

sort test
15.786885639721334
17.872245663092389
22.043748593228031
37.250686063441229
42.479883979859579
46.137437069574844
57.521475211810717
59.085433616822840
69.734186626354870
76.388409606510635

loop towards 2.02 in 0.02 steps
1.92
1.94
1.96
1.98
2.00
2.02

2.0 - 0.02 = 1.98

2.0 * 0.02 = 0.04

2.0 / 0.02 = 100.00

abs(-1.9) = 1.9

10.25 ^ 2.0 = 105.0625

square(123.25) = 11.10180165558725877924429226916325


NB you can only raise to integer powers.

get it from my website.


Beaker(Posted 2006) [#2]
Nice work. And I like your website, lots of useful things there.


Chris C(Posted 2006) [#3]
thank, some feedback!!

I've found a better library with all the brl.math functions and many more which allows 100 digit percision!

Its working wonderfully, but a fair bit still to wrap!