Re: Divide by Zero
Per Bolmstedt <[email protected]> Tue, 26 Feb 2008 04:28:37 -0500
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
On Tue, 26 Feb 2008 10:35:15 +0100, Frans Bouma <[email protected]> wrote: >> In a little more than a nutshell, why does the CLR only throw a divide by >> zero exception for integers? > > I think because, if I recall correctly, a floating point number is > always an approximation, so you can have a floating point value > which seems 0 but actually isn't. I disagree. PositiveInfinity, for example, is not an approximation. It's really infinity. http://msdn2.microsoft.com/en-us/library/system.double.positiveinfinity.aspx I found this concisely helpful: http://grouper.ieee.org/groups/754/faq.html#exceptions Couldn't it be seen as that decimal/integer have been simplified in the CLR (for programmers), whereas single/double retain their complexity (for mathematicians)? =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com