2

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?

Gistiv
  • 167
  • 2
  • 9
  • 2
    regarding the real question: yes, for example the [VAX format](https://nssdc.gsfc.nasa.gov/nssdc/formats/VAXFloatingPoint.htm) or the IBM format which uses base 16 and 7 bits for the exponent [Do any real-world CPUs not use IEEE 754?](https://stackoverflow.com/q/2234468/995714) https://mrob.com/pub/math/floatformats.html – phuclv May 25 '18 at 06:29

1 Answers1

6

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

Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252