From owner-freebsd-hackers Tue Jan 4 6:37:26 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from kronos.alcnet.com (kronos.alcnet.com [63.69.28.22]) by hub.freebsd.org (Postfix) with ESMTP id ABD0B15265 for ; Tue, 4 Jan 2000 06:37:17 -0800 (PST) (envelope-from kbyanc@posi.net) X-Provider: ALC Communications, Inc. http://www.alcnet.com/ Received: from localhost (kbyanc@localhost) by kronos.alcnet.com (8.9.3/8.9.3/antispam) with ESMTP id JAA33212; Tue, 4 Jan 2000 09:36:59 -0500 (EST) Date: Tue, 4 Jan 2000 09:36:59 -0500 (EST) From: Kelly Yancey X-Sender: kbyanc@kronos.alcnet.com To: Martin Cracauer Cc: Markus Holmberg , freebsd-hackers@FreeBSD.ORG Subject: Re: Should -mieee-fp equal fpsetmask(0) to avoid SIGFPE on FreeBSD? In-Reply-To: <20000104121459.A8959@cons.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > #include > #include > #include > > 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 - kbyanc@posi.net - 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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message