This is an archive of the discontinued LLVM Phabricator instance.

[flang] runtime: For Fw.d formatting, don't oscillate forever
ClosedPublic

Authored by klausler on Aug 4 2021, 11:17 AM.

Details

Summary

The algorithm for Fw.d output will drive binary to decimal conversion for
an initial fixed number of digits, then adjust that number based on the
result's exposent. For value close to a power of ten, this adjustment
process wouldn't terminate; e.g., formatting 9.999 as F10.2 would start
with 1e2, boost the digits to 2, get 9.99e1, decrease the digits, and loop.
Solve by refusing to boost the digits a second time.

Diff Detail

Event Timeline

klausler created this revision.Aug 4 2021, 11:17 AM
klausler requested review of this revision.Aug 4 2021, 11:17 AM
PeteSteinfeld accepted this revision.Aug 4 2021, 11:53 AM

All builds, tests, and looks good.

This revision is now accepted and ready to land.Aug 4 2021, 11:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2021, 12:24 PM