Search code examples
floating-pointbinaryfilesbinary-datadata-conversionieee-754

Are there any 32bit floating point representations besides the IEEE754


Foreword:

I'm currently trying do decrypt an old binary format (was developed in the mid to late 1980s in Japan) which has stored float values in 4 byte blocks that aren't converted with the IEEE754 standard. I have a program that converts the values for me, so I can manipulate the binary file to change the values stored and see the outcome, but I can't figure out how to interpret them.

I did interpret every possible permutation of the 4 bytes as an IEEE float but none of them where correct, so I can say it is no endianness-problem nor is it a floating point number representation I know or could find on the internet.

I've tried to look into the assembly of the program I use, but my assembler skills aren't good enough to get anything out of it.

Here are some examples:

  • A0 78 2D 00 = 298.
  • A0 78 2D 01 = 1975.7
  • A0 78 2D 02 = 3653.4
  • A0 78 2C 00 = 291.4
  • A0 78 2C 02 = 3646.8

Actuall Question:

Are there any other (old) 32bit floating point representations which are/where used besides/before the IEEE754 standard?


Solution

  • It is not a floating point representation but a fixed point one. The binary 4 byte blocs are little endian 32 bits integers, representing the floating point value mutiplied by 10000:

    Byte repr.   int hexa   int dec. int val / 10000.
    A0 78 2D 00  0x002d78a0  2980000 298.0
    A0 78 2D 01  0x012d78a0 19757216 1975.7216
    A0 78 2D 02  0x022d78a0 36534432 3653.4432
    A0 78 2C 00  0x002c78a0  2914464 291.4464
    A0 78 2C 02  0x022c78a0 36468896 3646.8896
    

    This is commonly used to represent decimal numbers when precision is fixed and when you want exact operations, for example to represent currencies