3 ms·
Could you please explain me why 2 would be the correct answer?
by GTP 3y ago
Could you please explain me why 2 would be the correct answer?
- Retr0id 3y agoParsing the provided numbers to two IEEE 754 double-precision floats, and then subtracting them, yields 2.0 (due to rounding) In particular, 9999999999999999.0 rounds up to 10000000000000000.0 (note, this behavior depends on the rounding mode, https://en.wikipedia.org/wiki/IEEE_754#Rounding_rules https://en.wikipedia.org/wiki/IEEE_754#Rounding_rules )
- GTP 3y agoBut here rounding is giving you the wrong answer.