Floating-Point Precision Loss
Floating-point precision loss happens when a program uses float or double for values that require exact arithmetic. In CTF binaries, this often appears in financial logic, scoring systems, games, shops, or resource counters.
The bug comes from the fact that floating-point numbers cannot represent every value exactly. As numbers grow larger, the gap between representable values also grows. If a program subtracts a small value from a very large floating-point balance, the result may round back to the original value.
For example, a purchase may do:
1
2
balance -= price;
owned_items += amount;
If balance is large enough and price is small enough, the subtraction may not change balance, but the item is still credited. Selling the item later can then create money from nothing.