Date: Thu, 28 Feb 2002 04:30:02 -0800 (PST) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs@FreeBSD.org Subject: Re: misc/35381: incorrect floating-point display of large values when using round-upward IEEE mode Message-ID: <200202281230.g1SCU2m98240@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/35381; it has been noted by GNATS. From: Bruce Evans <bde@zeta.org.au> To: David Monniaux <monniaux@genievre.ens.fr> Cc: <freebsd-gnats-submit@FreeBSD.ORG> Subject: Re: misc/35381: incorrect floating-point display of large values when using round-upward IEEE mode Date: Thu, 28 Feb 2002 23:30:06 +1100 (EST) On Wed, 27 Feb 2002, David Monniaux wrote: > >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). This will have to be fixed to support C99, but the general problem is large and won't be fixed soon. C99 seems to require the following (if support for its equivalent fesetround() is actually claimed): - functions like printf(), scanf() and strtod(), and lower-level ones related to rounding must honour the current rounding mode. I don't know how hard this is. - other lower-level functions must not depend on the rounding mode. This basically requires pessimizing all the functions by context- switching to the default rounding mode while executing them. Using fpsetprec() and fpsetmask() to change the defaults causes similar problems, but there are no corresponding interfaces in C99, and it's not clear how non-default precisions should affect standard functions. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202281230.g1SCU2m98240>