From owner-freebsd-hackers Thu Dec 23 5:42: 4 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from axl.noc.iafrica.com (axl.noc.iafrica.com [196.31.1.175]) by hub.freebsd.org (Postfix) with ESMTP id 0D7E414E0C for ; Thu, 23 Dec 1999 05:42:00 -0800 (PST) (envelope-from sheldonh@axl.noc.iafrica.com) Received: from sheldonh (helo=axl.noc.iafrica.com) by axl.noc.iafrica.com with local-esmtp (Exim 3.11 #1) id 1218Wn-000Dgq-00 for hackers@FreeBSD.org; Thu, 23 Dec 1999 15:43:37 +0200 From: Sheldon Hearn To: hackers@FreeBSD.org Subject: SIGFPE on arithmetic overflow Date: Thu, 23 Dec 1999 15:43:37 +0200 Message-ID: <52627.945956617@axl.noc.iafrica.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi folks, I'm looking for an explanation of a difference I've found between NetBSD and FreeBSD in the handling of arithmetic overflow in typecasting. The following code, compiled on a stock FreeBSD 4.0-CURRENT machine cores on SIGFPE. On a NetBSD 1.4.1 machine (gcc-2.91.60), the program prints the value of INT_MAX. int main(void) { double x; int i; x = 1e19; i = (int)x; printf("%d\n", i); return 0; } So can anyone explain the cause of this difference to me? :-) Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message