Talk:Detect division by zero: Difference between revisions
Content added Content deleted
No edit summary |
mNo edit summary |
||
Line 21: | Line 21: | ||
::: I don't know of any conventional mathematical context in which "<math>\frac{1}{0}</math>" or "<math>\frac{0}{0}</math>" has a meaningful, sensible, and unambiguous value. —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 18:42, 19 June 2010 (UTC) |
::: I don't know of any conventional mathematical context in which "<math>\frac{1}{0}</math>" or "<math>\frac{0}{0}</math>" has a meaningful, sensible, and unambiguous value. —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 18:42, 19 June 2010 (UTC) |
||
:::: I thought 1/0 was often accepted to represent an infinity, though I can agree that infinities are not necessarily sensible nor unambiguous. That said, mathematics seems capable of dealing with such subjects. --[[User:Rdm|Rdm]] 02:58, 20 June 2010 (UTC) |
:::: I thought 1/0 was often accepted to represent an infinity, though I can agree that infinities are not necessarily sensible nor unambiguous. That said, mathematics seems capable of dealing with such subjects. --[[User:Rdm|Rdm]] 02:58, 20 June 2010 (UTC) |
||
:::: Limits are such a context. <math>\lim_{n\rightarrow+0}\frac 10</math> ''converges to'' (positive) infinity. It's not ''actually'' a value per se. |
Revision as of 09:26, 20 June 2010
Many of the solutions here simply check that the result is infinite. This will fail if the numerator is 0 too, since 0 / 0 is mathematically incalculable (many languages return NaN here).
A correct pseudocode solution is:
result = numerator / denominator if numerator equals 0 if result is not a number divide by zero action end else if result is infinite divide by zero action end end
- 0 / 0 is NOT mathematically incalculable -- it is trivially calculable. The problem with 0 / 0 is that any numerical answer is a valid answer. In other words NaN is not a valid result for 0 / 0 but is a description of the character of those answers. (The result can be any of an infinite variety of numbers and not just "a" single number.) This is a problem in mathematics because the result, by itself, is not sufficient to prove anything. Thus, we at times use limits and other constructs to reason about cases involving 0 / 0. A less deceptive result than NaN for 0 / 0 would be "Any Number", but to my knowledge no languages implement that. --Rdm 18:19, 18 June 2010 (UTC)
- I don't know what "mathematically incalculable" means, but I can testify that in pure mathematics, division by zero, regardless of the dividend, is undefined. Expressions such as , though they may appear to involve division by zero, actually don't. This expression, for instance, means "the number y such that for all positive ε there exists a positive δ such that for all , ", i.e., 0. —Underscore (Talk) 01:04, 19 June 2010 (UTC)
- According to the wikipedia "In mathematics, defined and undefined are used to explain whether or not expressions have meaningful, sensible, and unambiguous values. Whether an expression has a meaningful value depends on the context of the expression. For example the value of 4 − 5 is undefined if a positive integer result is required." And the problem with 0/0 is the cardinality of the result, not the lack of any results. --Rdm 11:37, 19 June 2010 (UTC)
- I don't know of any conventional mathematical context in which "" or "" has a meaningful, sensible, and unambiguous value. —Underscore (Talk) 18:42, 19 June 2010 (UTC)
- I thought 1/0 was often accepted to represent an infinity, though I can agree that infinities are not necessarily sensible nor unambiguous. That said, mathematics seems capable of dealing with such subjects. --Rdm 02:58, 20 June 2010 (UTC)
- Limits are such a context. converges to (positive) infinity. It's not actually a value per se.
- I don't know of any conventional mathematical context in which "" or "" has a meaningful, sensible, and unambiguous value. —Underscore (Talk) 18:42, 19 June 2010 (UTC)
- According to the wikipedia "In mathematics, defined and undefined are used to explain whether or not expressions have meaningful, sensible, and unambiguous values. Whether an expression has a meaningful value depends on the context of the expression. For example the value of 4 − 5 is undefined if a positive integer result is required." And the problem with 0/0 is the cardinality of the result, not the lack of any results. --Rdm 11:37, 19 June 2010 (UTC)