SRL Archive - OSR Help

Long Decimal numbers being rounded?


Xtensity

2010-06-29 14:49:30

How come in any math script I try to make all my extended numbers are rounded to the nearest tenth.

Also how come I can not assign decimals such as .03 or .97 to extended variables.

I'm trying to make a script to calculate extremely small dilutions that can go to the hundredth or thousandths decimal place. I know the math and everything, the only problem is scar rounding my decimals(from calculations such as 3/100 which shows 0 instead of .03), and I can't assign decimals such as x:=.03…. etc


I know it is possible in scar, since functions like ArcTan can return decimal numbers with up to 15-16 places, which it is returning an extended number and not rounding it like it does with my own calculations.

What am I doing wrong/not doing?

Frement

2010-06-29 14:50:07

Use floats like: 0.03 and 0.97


And use 3.0/100.0 and I think it will return the number you want.

Xtensity

2010-06-29 14:52:14

Thanks, worked like a charm :D

Frement

2010-06-29 14:58:37

No problem. If you got more questions, feel free to add me on MSN: [email]frement@windowslive.com[/email]

I'm online almost all the time.

FrostFyr

2010-06-29 21:49:12

Took me a bit to figure that out too, but scar just sees two integers and divides them as such, if it see's one is a extended (Float) it'll treat the whole sum as one. I usually just multiply the answer by 1.0, works as well :)