| Author |
Floating Point Number and dividebyzero arithmatic exception
|
veer jain
Greenhorn
Joined: Mar 19, 2008
Posts: 5
|
|
Why does the Floating Point numbers does NOT produce the dividebyzero arithmatic exception ?? The above code runs fine, But Why ?? Why is it designed like that ?? It should through an exception... Any Thgoughts ? Regards Veer
|
 |
Jelle Klap
Bartender
Joined: Mar 10, 2008
Posts: 1409
|
|
|
Because IEEE 754 specifies that division by zero for floating point numbers should result in either positive or negative infinity depending on the sign bit.
|
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
|
 |
Gitesh Ramchandani
Ranch Hand
Joined: Feb 28, 2007
Posts: 274
|
|
* if the value of the divisor in floating-point division is 0 no exception is thrown; the value of the results are as follows: o division of a positive floating-point value: POSITIVE_INFINITY o division of a negative floating-point value: NEGATIVE_INFINITY o division of a floating-point value by -0: POSITIVE_INFINITY
|
 |
veer jain
Greenhorn
Joined: Mar 19, 2008
Posts: 5
|
|
|
Thanks a ton Guys !!
|
 |
 |
|
|
subject: Floating Point Number and dividebyzero arithmatic exception
|
|
|