From owner-freebsd-bugs Wed Feb 27 9:40:19 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 60E9A37B41D for ; Wed, 27 Feb 2002 09:40:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1RHe0F30737; Wed, 27 Feb 2002 09:40:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id DDF6037B41A for ; Wed, 27 Feb 2002 09:31:05 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1RHV5d29073; Wed, 27 Feb 2002 09:31:05 -0800 (PST) (envelope-from nobody) Message-Id: <200202271731.g1RHV5d29073@freefall.freebsd.org> Date: Wed, 27 Feb 2002 09:31:05 -0800 (PST) From: David Monniaux To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/35381: incorrect floating-point display of large values when using round-upward IEEE mode Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 35381 >Category: misc >Synopsis: incorrect floating-point display of large values when using round-upward IEEE mode >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Feb 27 09:40:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: David Monniaux >Release: 4.4 >Organization: ENS >Environment: FreeBSD airelle 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Mon Jan 7 11:46:25 CET 2002 root@airelle:/usr/src/sys/compile/AIRELLE i386 >Description: Very large floating-point values (very close to the maximal non infinite number for the current IEEE precision mode, i.e. DBL_MAX = 1.7976931348623157E+308 when left to the default) are displayed incorrectly if the system has been put in round-upward mode (using fpsetround()). The output string is not even a valid number (contains a colon in place of a digit). >How-To-Repeat: #include #include main() { fpsetround(FP_RP); printf("%g\n", 1E308); } airelle% ./essai :e+307 ^^ incorrect display >Fix: Save/restore the floating-point rounding mode (and possibly precision mode) around library functions that expect a particular mode. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message