01-11-2005 14:42
CODE

//x is a constant 2.0P+2
float m=2.0P+x;
m==2.0*llPow(2,x);

what p does is mulitply your number by 2 to the power of x; where x is an integer. This would be easy enough to implement as it would only effect the exponential portion of the float. This would allow for easy & fast lossless float -> string functions.

CODE

llFloat2String(float a)
{
string c;
if(a!=0.0)
{
integer b=llFloor(4.0-llLog10(llFabs(a))/0.30102999566398119521373889472449);
if(b)
{
a*=llPow(2,llFloor(b*0.5));//keeps LSL from generating floats it can't store
a*=llPow(2,llCeil(b*0.5));
c="P"+llDeleteSubString("+",(b<=0),1)+(string)(-b);
}
}
return (string)a+c;
}
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey