>
> #include <stdio.h>
> #include <limits.h>
> #include <floatingpoint.h>
>
> int main(void)
> {
> double bla;
> int foo;
>
> fpsetmask(0);
> bla = (double)INT_MAX + 1.0;
> foo = bla;
>
> printf("Result: %d\n", foo);
>
> return 0;
> }
>
> Result: -2147483648
>
>
Actually, this the same value (INT_MIN = -2147483648) you would get if
you just said foo = INT_MAX + 1 since in 2's complement notation INT_MIN =
INT_MAX + 1. It definately isn't garbage. Nonetheless, your point is
valid, floating point exceptions do exist for a purpose.
Kelly
--
Kelly Yancey - [EMAIL PROTECTED] - Richmond, VA
Analyst / E-business Development, Bell Industries http://www.bellind.com/
Maintainer, BSD Driver Database http://www.posi.net/freebsd/drivers/
Coordinator, Team FreeBSD http://www.posi.net/freebsd/Team-FreeBSD/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message