▲ 7 r/codeforces
Minor misprint or I am stupid
This excerpt is from the cp handbook. The percentages of programming languages used seem to add up to more than 100.
u/OkLeader681 — 2 days ago
This excerpt is from the cp handbook. The percentages of programming languages used seem to add up to more than 100.
Most solutions use epsilon = 1e-6 because floating-point evaluation may produce a value slightly different from 24 even when the exact mathematical result is 24.
What I don’t understand is why 10^−6 is specifically safe. Why not 10^−4, 10^−8, or some other value?
In particular, how do we know that an expression whose exact value is not 24 cannot nevertheless lie within 10^-6 of 24, causing a false positive?
I do not get the intuition for this. Please help