In lab for Week 1, can someone explain why the evaluation y+x (-10 + 10) is not 0?

If the library was doing integer arithmetic, it would be zero. So they must be doing floating point here. Note that the answer is very close to zero: it is 0.0000…(a total of 124 zeros)…2.
Everything is an approximation in floating point. You can’t even exactly represent something as simple as \frac{1}{3}.
1 Like