-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang][runtime] Handle Fw.0 case that needs to round up to 1.0 (#74384)
A tricky case in Fw.d output editing is when the value needs to be rounded either to a signed zero or away from zero to a power of ten (1.0, 0.1, &c.). A bug report for LLVM on GitHub (#74274) exposed a bug in this code in the case of Fw.0 editing where a value just over 0.5 was rounded incorrectly to 0 rather than 1 when no fractional digits were requested. Rework that algorithm a little, ensuring that the initial binary->decimal conversion produces at least one digit, and coping correctly with the rounding of an exact 0.5 value for Fw.0 editing (rounding it to the nearest even decimal, namely 0, following near-universal compiler-dependent behavior in other Fortrans). Fixes #74274.
- Loading branch information
Showing
2 changed files
with
72 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters