- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've noticed a "recent" change in the behavior of the -standard-semantics flag, concerting the printing format of long exponents.
Best shown with an example:
program test
use iso_fortran_env
character(len=*), parameter :: frmt = '(4(1x,es21.14))'
write(output_unit,frmt) tiny(1.0_real32), huge(1.0_real32), -tiny(1.0_real32), -huge(1.0_real32)
write(output_unit,frmt) tiny(1.0_real64), huge(1.0_real64), -tiny(1.0_real64), -huge(1.0_real64)
write(output_unit,frmt) tiny(1.0_real128), huge(1.0_real128), -tiny(1.0_real128), -huge(1.0_real128)
write(output_unit,*) tiny(1.0_real128), huge(1.0_real128), -tiny(1.0_real128), -huge(1.0_real128)
end program testOutput with gfortran 11.4.0 (as expected, note the E is omitted in the second line):
1.17549435082229E-38 3.40282346638529E+38 -1.17549435082229E-38 -3.40282346638529E+38
2.22507385850720-308 1.79769313486232+308 -2.22507385850720-308 -1.79769313486232+308
********************* ********************* ********************* *********************
3.36210314311209350626267781732175260E-4932 1.18973149535723176508575932662800702E+4932 -3.36210314311209350626267781732175260E-4932 -1.18973149535723176508575932662800702E+4932Output with ifx 2025.3.0 is similar, but when adding -standard-semantics (E is never omitted, causing stars with negative numbers):
1.17549435082229E-38 3.40282346638529E+38 -1.17549435082229E-38 -3.40282346638529E+38
2.22507385850720E-308 1.79769313486232E+308 ********************* *********************
********************* ********************* ********************* *********************
3.362103143112093506262677817321753E-4932
1.189731495357231765085759326628007E+4932
-3.362103143112093506262677817321753E-4932
-1.189731495357231765085759326628007E+4932This was not the case with ifx 2024.0.2 (E was omitted as with gfortran).
Is this change intended? Is it spec-compliant? Is it documented? Can it be disabled (while keeping -standard-semantics)?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe this is an error on the part of ifx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like ifx emits an incorrect ES format-mode flag, which is passed further to for_write_seq_fmt. There is no problem with the ifx 2024.2.1 version.
I escalated it to the development team (CMPLRLLVM-74145). Thank you for your report.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page