Help for this page

Select Code to Download


  1. or download this
    # This is from memory so may not work
    $binary_struct = read_from_somewhere();
    $was_bits = unpack("b64",$binary_struct);
    $now_bits = shuffle_bits($was_bits);
    $float_val = unpack("d",pack("b64",$now_bits));
    
  2. or download this
    sub deduce_endian
      {
    ...
        # Then map this to our double representation
        deduce_endian() if(!$endian);
        return &{$binary2double_fun}($out) if($binary2double_fun);