Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

math question

Alberto McGettigan
Registered User
Join date: 14 Jun 2005
Posts: 57
11-17-2005 00:37
Hello

Having a small prob. trying a simple math equation(really simpl) and i dont get the correct answer. used llFloor to round down ie get read of the decimal places but now when i DO want them it only gives the round down answer even if i delete the function or type the script again any question gives the rounded off answer. Its like i have to turn the function off now like its on for every question in any script. Can someone help?
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
11-17-2005 01:01
Could be a problem with integers? Make sure that all the variables you are using are explicitly changed to floats before doing anything with them. I.e. (float)foo / (float)bar etc.

It might also help to see the code.
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
11-17-2005 02:01
Yea...sounds like an integer vs. float problem:

integer = whole number
float = decimal
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Alberto McGettigan
Registered User
Join date: 14 Jun 2005
Posts: 57
11-17-2005 03:03
thanks a bunch im sure thats it