Perhaps the most useful aspect of IEEE floating-point is how divide-by-zero is handled; for any positive real number a, what are the 2 rules involving division by 0?
Perhaps the most useful aspect of IEEE floating-point is how divide-by-zero is handled; for any positive real number a, what are the 2 rules involving division by 0?
1. +a / +0 = +∞
2. -a / +0 = -∞
a = f(x)
if(a > 0) {
do something
}
What does the if-statement evaluate to when:
a = +∞?
a = -∞?
a = NaN?
+∞ > 0 = true
-∞ > 0 = false
NaN > 0 = false