[J3] [SC22WG5.6474] [EXTERNAL] [BULK] raising a negative real value to a real power is prohibited
Clune, Thomas L. (GSFC-6101)
thomas.l.clune at nasa.gov
Wed Aug 23 13:11:24 UTC 2023
What would you expect for the output of this modified program?
program main
implicit none
real :: x, y
x = -2.0
y = 0.5
print*,x**y
end program main
I.e., are you wanting the compiler to detect that a given float is close enough to an integer that the result is real rather than complex? Or are you expecting the compiler to convert all such expressions to complex when x is negative?
From: J3 <j3-bounces at mailman.j3-fortran.org> on behalf of j3 <j3 at mailman.j3-fortran.org>
Reply-To: j3 <j3 at mailman.j3-fortran.org>
Date: Wednesday, August 23, 2023 at 8:22 AM
To: WG5 <sc22wg5 at open-std.org>
Cc: Jeff Hammond <jehammond at nvidia.com>
Subject: [EXTERNAL] [BULK] [J3] [SC22WG5.6473] raising a negative real value to a real power is prohibited
CAUTION: This email originated from outside of NASA. Please take care when clicking links or opening attachments. Use the "Report Message" button to report suspicious messages to the NASA SOC.
Do I understand the following text correctly, that is, that the following program is prohibited, even though it perfectly well-defined mathematically?
“10.1.5.2.4 Evaluation of numeric intrinsic operations
The execution of any numeric operation whose result is not defined by the arithmetic used by the processor is prohibited. Raising a negative real value to a real power is prohibited.”
program main
implicit none
real :: x, y
x = -2.0
y = 2.0
print*,x**y
end program main
The first sentence is completely reasonable and seems sufficient to cover the problematic cases. I do not understand why the second sentence is necessary.
Thanks,
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20230823/9a4ac7a7/attachment-0001.htm>
More information about the J3
mailing list