Re: Divide by Zero

Per Bolmstedt <[email protected]> Tue, 26 Feb 2008 05:10:14 -0500
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <LISTSERV%[email protected]>
On Tue, 26 Feb 2008 11:04:56 +0100, Frans Bouma <[email protected]> wrote:

>>> 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.
>
> Though how would you store 'e' or 'pi' ? You have just 4 or 8 bytes.

I think you read my response out of context. You are positing that the
reason for not throwing an exception when dividing a floating-point number
by zero is that floating-point numbers are always approximations. That's
with which I'm disagreeing, not your understand of floating-point arithmetic
(which obviously by far surpasses mine). The IEEE floating-point rules
dictate the CLR behavior. I just wanted to point out that not all
singles/doubles in the CLR are approximations.

Pi should be stored as a recursive lambda expression, of course. ;]

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com