News for hackers. Stuff that matters.
Re:1/0 = 0 by seanmcdirmid on Friday August 10, 2018 @04:39PM (#17736568)
Typically, divide by zero throws for integers because they can’t express NaN, which can instead be returned for floating point. In any case, integers can’t express special values, so you get exceptions instead. And this is actually defined at the processor level (for x86 among others), the trap is free (well, a sunk cost), why not take it?

Zero is not a very good NaN.

Re:1/0 = 0 by cousin_it on Friday August 10, 2018 @04:44PM (#17736596)
Yeah, agreed. The thing with 1/0=0 is bizarre, I guess my comment was more about why NaNs are okay.