@emd@ethernick if I had to guess, 2.2 stored as a float has some error making it slightly greater than 2.2. Division makes the answer slightly less than 100.0, and intval lops off the IEEE 754 remainder.
Straight division follows saner rounding rules than intval when representing the value as a string.
@emd@perfect5th@ethernick The real value of 220/2.2 might be something like 99.99999999999999, when dealing with floating point numbers, and that’s very different from your hard-coded 100.0.
Add comment