Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on How does your programming language handle “minus zero” (-0.0)?. Parent comment
The division by 0 in that article gives the same ArithmeticError in each case, notice the 0.0 in both errors:
iex(8)> 1.0 / -0.0 ** (ArithmeticError) bad argument in arithmetic expression: 1.0 / 0.0 :erlang./(1.0, 0.0) iex(8)> 1.0/0.0 ** (ArithmeticError) bad argument in arithmetic expression: 1.0 / 0.0 :erlang./(1.0, 0.0)
iex(10)> Float.round(-0.01, 1) 0.0 iex(11)> Float.round(0.01, 1) 0.0
There are no comments on this comment yet.
The division by 0 in that article gives the same ArithmeticError in each case, notice the 0.0 in both errors:
It's also ignored when rounding: