Arc Forumnew | comments | leaders | submitlogin
2 points by drcode 5838 days ago | link | parent

wow- I never would have expected that... It seems that anyone who has a computer program dividing by zero would want an exception raised or at least have an NaN generated. Generating "0" makes no sense- In my scenario, for instance, the function limit was towards 1, so generating a zero is mathematically seemingly completely nonsensical.... Thanks for straightening me out, kens :-)


5 points by stefano 5838 days ago | link

In floating point arithmetic 0.0 isn't zero: it represent a range of numbers around zero, so it makes a little sense for 0/0.0 to return 0.0. I still think that raising an exception would be preferable.

-----

6 points by cchooper 5838 days ago | link

To be pedantic, it doesn't make any sense to return 0.0, but it does make some sense to return 0. I'm sure that's what you meant though.

It's 0.0/0.0 that gets my head spinning. If only 'Whatever' were a valid number.

-----

4 points by Jesin 5836 days ago | link

Well, it depends.

  lim{x -> 0}(x/x) = 1
  lim{x -> 0}(x/0) = NaN
  lim{x -> 0}(0/x) = 0

-----