hjp: Programs: ieeefloat

ieeefloat

Prints binary representations of IEEE 754 FP numbers.

For example the command

ieeefloat 1 2 3 3.1415926536 -2.7 1e10 2e100 -1.2345678901234567890e-30
prints
1
                       1: + 01111111111 [1.]0000000000000000000000000000000000000000000000000000
                       1: +    01111111 [1.]00000000000000000000000
2
                       2: + 10000000000 [1.]0000000000000000000000000000000000000000000000000000
                       2: +    10000000 [1.]00000000000000000000000
3
                       3: + 10000000000 [1.]1000000000000000000000000000000000000000000000000000
                       3: +    10000000 [1.]10000000000000000000000
3.1415926536
      3.1415926536000001: + 10000000000 [1.]1001001000011111101101010100010001001000011011100000
                3.141593: +    10000000 [1.]10010010000111111011011
-2.7
     -2.7000000000000002: - 10000000000 [1.]0101100110011001100110011001100110011001100110011010
                    -2.7: -    10000000 [1.]01011001100110011001101
1e10
             10000000000: + 10000100000 [1.]0010101000000101111100100000000000000000000000000000
                   1e+10: +    10100000 [1.]00101010000001011111001
2e100
                  2e+100: + 10101001100 [1.]0010010010011010110100100101100101001100001101111101
                     Inf: +    11111111 [1.]00000000000000000000000
-1.2345678901234567890e-30
 -1.2345678901234568e-30: - 01110011011 [1.]1001000010100011111000110011110001101001101011000011
           -1.234568e-30: -    00011011 [1.]10010000101000111110010

Here is the source. If you want to use the enclosed GNUmakefile, you will also need GNUmakerules and GNUmakevars, but you can simply compile the program by invoking the C compiler directly.

ieeefloat-1.1.tar.gz 2003-07-17 (1.8k)
Adds parameters to convert input to float and to control output format.
ieeefloat-1.0.tar.gz 1998-03-20 (1.5k)
$Date$

vim: sw=2