Using Compatible Compilers
Did you notice the change in the specs for
The interesting case is when the second argument is zero, because on platforms that support IEEE arithmetic (including Sun SPARC and UltraSPARC platforms), zero is actually a signed number. There is a positive zero and a negative zero. They are hard to tell apart in ordinary Fortran code, but numerical experts can take advantage of the signedness of zero to devise special algorithms. (See the Numerical Computation Guide.) Most programs can safely ignore the distinction.
In Fortran 90, the processor was required always to deliver a positive
result for
But in Fortran 95, the processor is allowed to do the correct thing
and deliver
The Sun Studio Fortran 95 compiler generally tracks the latest
standard. So you won't see
the old Fortran 90 behavior with current library releases. If you
require the Fortran 90 behavior,
the easiest thing to do is to make sure
that IF (B .EQ. 0.0) B = +0.0which may look like it does nothing but actually replaces negative real zero with positive real zero.
About the Author
Michael Ingrassia is the Sun Studio Fortran compiler technical lead, and the representative for Sun Microsystems at the ANSI Fortran standards committee. | |||||||||||||||||
|
| ||||||||||||