Landing: aacccc01d2bb

Project / Subsystem

gcc / fortran

Date

2026-05-24

Author

Jerry DeLisle

Commit

aacccc01d2bb3dd76ee37281b9f2f04aa9c13f5c

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
fortran
patch_id
commit_hash
aacccc01d2bb3dd76ee37281b9f2f04aa9c13f5c
source_type
github
headline
Fortran: Add EX Format Rounding for Truncated Hex Mantissa
tldr
Implements proper rounding of the hex mantissa in Fortran's EX format, supporting all rounding modes and normalization.
author
Jerry DeLisle
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • fortran
  • rounding
  • io
  • formatting
discussion_id_link
bugzilla_pr
date
2026-05-24T00:00:00.000Z

This commit enhances Fortran’s EX format to correctly round the hexadecimal mantissa when the user specifies a precision smaller than the full precision. It implements all Fortran rounding modes, including ties-to-even, ties away from zero, round up, round down, and round to zero. The implementation also handles carry propagation and normalizes the output by adjusting the exponent when incrementing a mantissa causes it to overflow.