This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: printf("%0.0f", 0.5) yields unexpected result (0)


Tim Prince wrote:

[ Q: Why round to nearest even ?
  A: To forgo bias in rounding down or up always ]

> This rounding to nearest even procedure was adopted long ago in the
> IEEE-P754 standard, after much research.  It is the native behavior of
> nearly all floating point chips designed over the last 20 years.  The
> Fortran standard perpetuates potentially serious performance problems by
> insisting on the older style of rounding.

Note that active Standard Development is gearing towards giving Fortran
(200x) enough expressiveness to include support for IEEE-754, if the
processor supports it.

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://g95.sourceforge.net/ (under construction)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]