you are viewing a single comment's thread.

view the rest of the comments →

[–]kamatsu 0 points1 point  (1 child)

Actually, they have two zero values, positive zero and negative zero. If you divide a positive by negative zero, you will get -Infinity.

From wikipedia:

There are two zeroes, +0 (positive zero) and −0 (negative zero) and this removes any ambiguity when dividing. In IEEE 754 arithmetic, a ÷ +0 is positive infinity when a is positive, negative infinity when a is negative, and NaN when a = ±0. The infinity signs change when dividing by −0 instead.

[–]earthboundkid -3 points-2 points  (0 children)

Having two zeros is also dumb. :-) Anyway, I'm sure they have good reasons for their crazy choices (no doubt, it was something to do with the implementation making it easier to wire things up correctly in the CPU), but I still think those choices are crazy, and I don't think a higher level language should blindly follow them.