// Float2Hex , Copyright Strife Onizuka string hexc="0123456789ABCDEF"; string Float2Hex(float a) {// Copyright Strife Onizuka, 2006, LGPL, http://www.gnu.org/copyleft/lesser.html if(a>0.0) { float b = llFabs(a);//logs don't work on negatives. string f = "p"; //floor(log2(b)) integer c = llFloor(llLog(b) / 0.69314718055994530941723212145818); if(c > 127) c = 127;//catch fatal rounding error in exponent. //shift up into integer range integer d = (integer)((b / (float)("0x1p"+(string)c)) * 0x1000000); while(!(d & 0xf)) {//strip extra zeros off before converting or they break "p" d = d >> 4; c+=4; } do { f = llGetSubString(hexc,15 & d,15 & d) + f; } while(d = d >> 4); if(a < 0) return "-0x" + f +(string)(c - 24); return "0x" + f +(string)(c - 24); } return "0";//zero would hang the zero stripper. } default { state_entry() { llSay(0,Float2Hex(PI)); } }