News for hackers. Stuff that matters.
Re:1/0 = 0 by lisael on Friday August 10, 2018 @08:23PM (#17737604)
Meanwhile, in Python...

  In [1]: 255 + 1 is 256
  Out[1]: True
  In [2]: 256 + 1 is 257
  Out[2]: False
Every language has its inconsistencies, when it comes to math, because they run on real-world computers. All these are "slow" interpreted languages that allow runtime failures and don't use plain machine integers. Just a different trade-off.

Anyway, the Inf/NaN trick is not better than the 0 trick in my opinion, because all subsequent operations result happily in NaN. I've never seen in any NaN language a program that checks for NaN the result of each and every division.

with a NaN-kind of language, it would be:

  a = b/c
  if a == NaN:
    print "oops"
with a 0-trick language:

  a = b/c
  if a == 0 and c == 0:
    print "oops"
not THAT different, IMO :)
Re:1/0 = 0 by PopeDotNinja on Saturday August 11, 2018 @12:22AM (#17738331)
When I make a language, there will be a OuchMyHeadHurtsCommaSpaceGotSomeAspirinQuestionMarkError.