The IEEE 754 standard determines the standard and structure of floating point numbers used by many and almost all modern systems. This standard has experienced an update in 2008 and is often called IEEE 754-2008 since then. But this little documentation is also dedicated to various systems released before 2008. It might be hard to understand how they work in detail so many examples used by various games of various systems will be given.

These are the most common floating point value types and their corresponding definitions. If you are interested in game hacking you may like to mind the representation of 1.0 in hexadecimal:

Name | Total Length |
Pre 2008 Compatible |
Usage | Systems | Exponent Size |
Mantissa Size |
Representation of 1.0 in hexadecimal |
---|---|---|---|---|---|---|---|

Mini Float | 8 Bits | UNK | Teaching | UNK | 4 Bits | 3 Bits | 38 |

Mini Float / Half Precision | 16 Bits | Yes | Teaching, Graphics | x64, x86, ARM | 5 Bits | 10 Bits | 3C00 |

Single Precision | 32 Bits | Yes | Most commonly used (Speed, Size, Audio Volume, Audio pitch, coordinates, colors and transparency, ...) | x64, x86, PowerPC, ARM, N64, GCN, Wii, Wii U, Switch, 3DS, PS2, PS3, PS4, PS Vita, XBOX, XBOX 360, XBOX ONE, ... | 8 Bits | 23 Bits | 3F800000 |

Double Precision | 64 Bits | Yes | Commonly used (Physics, ...) | x64, x86, PowerPC, ARM, GCN, Wii, Wii U, Switch, 3DS, PS2, PS3, PS4, PS Vita, XBOX, XBOX 360, XBOX ONE, ... | 11 Bits | 52 Bits | 3FF0000000000000 |

Double Extended Precision | 80 Bits | No | Less common | x64, x86, ... | 15 Bits | 64 Bits | 3FF0000000000000000 |

Quadruple Precision | 128 Bits | No | Less common | UNK | 15 Bits | 112 Bits | 3FFF0000000000000000000000000000 |

Octuple Precision | 256 Bits | No | Less common | UNK | 19 Bits | 237 Bits | 3FFFF000000000000000000000000000 00000000000000000000000000000000 |

- Converting a decimal fracture into floating point

Sign (1 Bit) |
Exponent (8 Bits) |
Mantissa (23 Bits) |
---|---|---|

• | •••••••• | ••••••••••••••••••••••• |

The first bit determines the sign. 0 = positive; 1 = negative.

The next 8 bits determine the exponent.

The left over 23 bits make the Mantissa, the value behind the dot.

Here's a simple example about how to convert the decimal fracture of

First you should determine the sign. As we can see there is no minus in front of our number. So it must be a positive number and our sign bit will be 0.

Next step is converting the value on the left side of the dot into binaries: 17 → 10001b. Now we have to calculate the fraction by multiplying the value of the right side of the dot by 2. Mind that the dot has to be carried. If the multiplication is equal or greater than 1 note a 1. If it's smaller than 1, note a 0. This procedure has to be done until the result is 0, infinitely repeats or you've have got 23 results:

0.75 * 2 = 1.5 1

0.5 * 2 = 1.0 1

0.0 * 2 = 0 0

└> 110

Use the result as mantissa:

Sign (1 Bit) |
Exponent (8 Bits) |
Mantissa (23 Bits) |
---|---|---|

0 | 00010001 | 11000000000000000000000 |

But we are not finished now. The exponent field has yet to be correctly aligned. Imagine a dot between the Exponent and Mantissa field:

00010001.11000000000000000000000.Now move the dot to the left until it reaches the first 1 of the exponent field and count how many digits it was moved: 0001.00011100000000000000000 the dot was moved by 4 digits. The exponent becomes as high as many digits the dot was moved. The base of our exponential term is always 2 because if we now multiply our number by 2⁴ we will get the previous one back (00010001.110...). We now have to add the amount of times a digit was skipped to 127. 127 + 4 = 131. We now convert this back into binaries and use it as our new exponent value. (127 is being used because it's the biggest value where the first bit of the exponent field stays 0. If it'd be anything higher, 255 for instance the addition would cause an overflow). 131 → 10000011. We can now complete our floating point value:

Sign (1 Bit) |
Exponent (8 Bits) |
Mantissa (23 Bits) |
---|---|---|

0 | 10000011 | 00011100000000000000000 |

Converting this binary number into hexadecimal leads you to 0x418E0000, the exact same number the float-to-hex converter has provided.

- Converting an IEEE Floating Point number into decima fracture

First convert the float into binaries:

Sign (1 Bit) |
Exponent (8 Bits) |
Mantissa (23 Bits) |
---|---|---|

0 | 10000100 | 00010000000000000000000 |

We can see that the sign is 0. So our number will be positive. Now convert the exponent field into decimal and subtract 127 from it.

10000100 → 132. 132 – 127 = 5

So we now have to put 1 into our exponent field followed by a dot and put the mantissa right behind it: 1.0001

This number has now to be multiplied by 2^5. First multiply the part on the left side of the dot by 2^5: 1 * 2⁵ = 32.

And now the part on the right side of the dot. Simply move the dot 5 digits to the right and add it to 32: 10.0000 = 2. 32 + 2 =

This is our converted float.

- Meaning of Floating Point Numbers to Video Game Hacking

- Examples of Floating Point Numbers

- Velocity/Speed

If you go backwards the floating point number will have a negative sign. 0x41C00000 (24.0) would become 0xC1C00000 (-24.0).

- Coordinates

Cheat codes like the

- Time

- 3D Models

- F-Curves

Below you can find screenshots of such an f-curve found in Zelda - The Wind Waker:

String of increasing floats

Increment until 1.0, then decrement

Decrement until -0.000000087, then increment into negative area

Tweet Follow @CosmoCortney