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]
Other format: [Raw text]

[Bug libfortran/48906] Wrong rounding results with -m32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48906

--- Comment #28 from Thomas Henlich <thenlich at users dot sourceforge.net> 2011-06-06 12:41:55 UTC ---
I had a look at the code and what I think we should do is the following:

If G editing and a scale factor p != 0 is in effect, split the rounding step
into 2 steps:

First, check if overflow occurs (.9999.. => 1.0000...) but do not actually
overwrite the digits yet.

With this information, we determine the final value of e.

If it turns out we need F editing: Repeat the rounding as above (or remember if
overflow occured the first time), and this time actually overwrite the digits.

If it turns out we need E editing: Set the new value for the number of digits
according to p and repeat the rounding.

It may help to refactor some of the code into a separate function, since we
need to call it twice.


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