J
Mon Mar 14 15:04:35 CST 2005
Hi Christopher,
Thank you. That explains it. Seems strainge and counter-productive to
me but that is the way it is.
John
On Mon, 14 Mar 2005 15:16:40 -0500, "Christopher C. Bernholt"
<cbernholt@ATrlcarriers.com> wrote:
>This may give you the info you're after:
>
http://visualbasic.about.com/od/usingvbnet/l/bldyknaninfa.htm
>
>J L wrote on 3/14/2005 :
>> I can do that but I dont understand why it did not throw an
>> exception...isn't dividing by 0 an error that should throw an
>> exception?
>>
>> Thanks,
>> John
>>
>> On Mon, 14 Mar 2005 20:30:32 +0100, "Herfried K. Wagner [MVP]"
>> <hirf-spam-me-here@gmx.at> wrote:
>>
>>> "J L" <john@marymonte.com> schrieb:
>>>> I was just playing around with error handling and put this code on a
>>>> button
>>>>
>>>> Dim sng1 As Single
>>>>
>>>> Try
>>>> sng1 = 1/0
>>>> MessageBox.Show(sng1.ToString)
>>>> Catch ex As Exception
>>>> MessageBox.Show(ex.Message, ex.TargetSite.Name
>>>> End Try
>>>>
>>>> To my dismay, the divide by zero doe not throw an exception and the
>>>> message box displays the word Infinity...why is this? I feel really
>>>> dumb right about now...but what can I say...
>>>
>>> Use 'If Single.IsInfinity(sng1) Then...' to check the result.