From owner-freebsd-amd64@FreeBSD.ORG Sat Jan 30 05:30:02 2010 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F1E5106566C for ; Sat, 30 Jan 2010 05:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E6FF48FC16 for ; Sat, 30 Jan 2010 05:30:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o0U5U1Ru039998 for ; Sat, 30 Jan 2010 05:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o0U5U1WI039994; Sat, 30 Jan 2010 05:30:01 GMT (envelope-from gnats) Resent-Date: Sat, 30 Jan 2010 05:30:01 GMT Resent-Message-Id: <201001300530.o0U5U1WI039994@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Nick Bowler Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1C221065693 for ; Sat, 30 Jan 2010 05:28:39 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 348518FC16 for ; Sat, 30 Jan 2010 05:28:39 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o0U5ScSe025756 for ; Sat, 30 Jan 2010 05:28:38 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o0U5Scte025755; Sat, 30 Jan 2010 05:28:38 GMT (envelope-from nobody) Message-Id: <201001300528.o0U5Scte025755@www.freebsd.org> Date: Sat, 30 Jan 2010 05:28:38 GMT From: Nick Bowler To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 X-Mailman-Approved-At: Sat, 30 Jan 2010 05:51:53 +0000 Cc: Subject: amd64/143358: nearbyint raises spurious inexact exception X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2010 05:30:02 -0000 >Number: 143358 >Category: amd64 >Synopsis: nearbyint raises spurious inexact exception >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jan 30 05:30:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Nick Bowler >Release: 8.9 >Organization: >Environment: FreeBSD amythaon.draconx.ca 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:02:08 UTC 2009 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: The nearbyint function is required by the C standard to *not* raise the inexact floating point exception, and the FreeBSD man page concurs. Nevertheless, the exception is raised on FreeBSD 8.0, as demonstrated by the following program: #include #include #include #pragma STDC FENV_ACCESS ON int main(void) { double val; fenv_t env; feholdexcept(&env); printf("inexact: %d\n", fetestexcept(FE_INEXACT) != 0); val = nearbyint(0x1.6p2); printf("inexact: %d\n", fetestexcept(FE_INEXACT) != 0); fesetenv(&env); printf("%f\n", val); return 0; } >How-To-Repeat: Compile and run the above program. It prints 0, 1 and 6.00000. It should print 0, 0 and 6.00000. >Fix: >Release-Note: >Audit-Trail: >Unformatted: