2

I discover today that 5.0/0 doesn't throw DivideByZeroException but it evaluates into infinity.

This infinity value can be multiplied by -1 and change into -infinity and can take part into other infinity mathematics.

What is the need of that and what are the practical implementations that needs this feature?

Maths forbids the division by 0, you can have infinity only when you divide by limit->0. Why they haven't introduced a new variable that represent the mathematic limit?

Menelaos Vergis
  • 3,715
  • 5
  • 30
  • 46
  • 1
    That's not quite right with regard to maths forbidding division by zero - the result of dividing a positive non-zero value by a number tending towards zero is a number that tends towards infinity - not infinity itself. – Enigmativity Sep 16 '15 at 09:52
  • 1
    Infinity is not a number, so tent to infinity and infinity are one and the same – Menelaos Vergis Sep 16 '15 at 09:53
  • https://en.wikipedia.org/wiki/Division_by_zero#Computer_arithmetic –  Sep 16 '15 at 09:54
  • 5
    Floating point math is defined in IEEE 754 (https://en.wikipedia.org/wiki/IEEE_floating_point). That should also answer your question, as it defines operations like division by zero. – Jan Henke Sep 16 '15 at 09:54
  • While division by zero is strictly undefined, mathematically, it can still be useful to be able to represent infinities programatically without special handling. – Will Vousden Sep 16 '15 at 09:57
  • See this Eric Lippert blog entry on the subject - http://blogs.msdn.com/b/ericlippert/archive/2009/10/15/as-timeless-as-infinity.aspx – Enigmativity Sep 16 '15 at 09:58
  • 1
    The question is not entirely duplicate but the answer is the same for this one. – usr Sep 16 '15 at 09:59
  • @MenelaosVergis - Infinity is a number. It defines the quantity of things. It is analogous to not considering 3.4 a number when you restrict your set of valid numbers to be integers. – Enigmativity Sep 16 '15 at 10:01
  • @Enigmativity If its a number then why infinity - infinity is not 0? – Menelaos Vergis Sep 16 '15 at 10:05
  • 1
    There are many concepts named "infinity". "Number" is not mathematically defined. There things called the set of integers or the set of reals. "Infinity" is not part of those sets. Arithmetic is not defined on "infinity". https://en.wikipedia.org/wiki/Infinity Engineers sometimes treat infinity as a number as a convenient shortcut, that's all. You won't find that in a math paper. Infinity is part of the set of all IEEE floating point numbers and operations on infinity have been made up to be convenient. – usr Sep 16 '15 at 10:09
  • @MenelaosVergis - I don't understand your question. – Enigmativity Sep 16 '15 at 10:12

0 Answers0