CODE
float rot = 0.0;
while (rot = rot + 0.1) {
if (rot = 10.1) {
rot = 0.0;
llDoTheRotationEtcEtcEtc(rot, etc);
}
}
This is pretty much an unbounded loop, for if
you print the values of rot you'll see stray numbers
appear after the 1st decimal point rather quickly.
But perhaps that is a bad example.
Consider this other example, one where we try to pretty-print (aka trimming off most of the garbage decimal places) the coords of a vector by multiplying, llRound()'ing and dividing: (Note that I haven't tested this exact code, but it illustrates something similar to what I had been trying to do in-world.
CODE
float x = 57.234323; // we pretend this is some x coord
// as returned by say llGetPos()
x = llRound(x * 100) / 100.0 ;
llSay(0, "x is " + (string)x);
Do you have a guess about what this printed out? Did you perhaps guess it would print out 57.23? That would be my guess. Unfortunately, in that one division by 100.0 we accrue .000007 in error so our pretty-printing fails and we end up with 57.229993 (or was it 57.230007?)
Can the environment's floating precision be improved?