[php]function convert_unreal ($arr) { $bin = implode($arr); $float = (float) 0; // Read Exponent and Sign (+/-) $exponent = ord ($bin{3}); if ($sign = $exponent & 128) $exponent -= 128; $exponent <<= 1; // Read the remaining bit for Exponent and loop through Mantissa, calculating the Fraction $fraction = (float) 1; $div = 1; for ($x=2; $x>=0; $x--) { $byte = ord ($bin{$x}); for ($y=7; $y>=0; $y--) { if ($x==2 && $y==7) { if ($byte & (1 << $y)) $exponent += 1; } else { $div *= 0.5; if ($byte & (1 << $y)) $fraction += $div; } } } // 0 value check if (!$exponent && $fraction == 1) return 0; // Final calc, returning the converted float $exponent -= 127; $float = pow (2, $exponent) * $fraction; if ($sign) $float = -($float); return $float; }[/php][php]function convert_unreal ($arr) { $bin = implode($arr); $float = (float) 0; // Read Exponent and Sign (+/-) $exponent = ord ($bin{3}); if ($sign = $exponent & 128) $exponent -= 128; $exponent <<= 1; // Read the remaining bit for Exponent and loop through Mantissa, calculating the Fraction $fraction = (float) 1; $div = 1; for ($x=2; $x>=0; $x--) { $byte = ord ($bin{$x}); for ($y=7; $y>=0; $y--) { if ($x==2 && $y==7) { if ($byte & (1 << $y)) $exponent += 1; } else { $div *= 0.5; if ($byte & (1 << $y)) $fraction += $div; } } } // 0 value check if (!$exponent && $fraction == 1) return 0; // Final calc, returning the converted float $exponent -= 127; $float = pow (2, $exponent) * $fraction; if ($sign) $float = -($float); return $float; }[/php][php]function convert_unreal ($arr) { $bin = implode($arr); $float = (float) 0; // Read Exponent and Sign (+/-) $exponent = ord ($bin{3}); if ($sign = $exponent & 128) $exponent -= 128; $exponent <<= 1; // Read the remaining bit for Exponent and loop through Mantissa, calculating the Fraction $fraction = (float) 1; $div = 1; for ($x=2; $x>=0; $x--) { $byte = ord ($bin{$x}); for ($y=7; $y>=0; $y--) { if ($x==2 && $y==7) { if ($byte & (1 << $y)) $exponent += 1; } else { $div *= 0.5; if ($byte & (1 << $y)) $fraction += $div; } } } // 0 value check if (!$exponent && $fraction == 1) return 0; // Final calc, returning the converted float $exponent -= 127; $float = pow (2, $exponent) * $fraction; if ($sign) $float = -($float); return $float; }[/php]