http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413
Bug #: 52413
Summary: Incorrect behavior of FRACTION when applied to a
constant
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libfortran
AssignedTo: [email protected]
ReportedBy: [email protected]
Hi,
I have a problem when applying "fraction" to a numerical constant, e.g.
fraction(-2.0); a minimal example says it all:
program test_frac
real::x,y
x=-2.0
x=fraction(x)
write(*,*)x
y=fraction(-2.0)
write(*,*)y
end program test_frac
The output is
-0.50000000
0.50000000
while one would expect
-0.50000000
-0.50000000
I experienced this with gfortran 4.4, 4.5 and 4.6 on Ubuntu systems. On ifort
12, the result is correct.
Regards,
FHR