Expected precision of Fortran FE constant evaluation
Jakub Jelinek
jakub@redhat.com
Fri Feb 8 18:27:00 GMT 2019
On Fri, Feb 08, 2019 at 10:21:27AM -0800, Steve Kargl wrote:
> result = 0
> result = result + 1.**2 ! result = 1
> result = result + 2.**2 ! result = 5
> result = result + huge(1.)**2 ! result = huge**2, same as 1 - epsilon/2 = 1
> result = sqrt(result) ! result = huge
>
> In looking at the code, there is no range_checking for norm2.
Thanks for looking at it. I guess for the PR which wants to set emin/emax
globally (unless temporarily overridden) the question is, can we throw away
the failing tests from norm2_3.f90 or replace the huge in there with
something smaller (I mean smaller than sqrt(huge()), so that **2 is still
finite) and adding 5 to it is too.
Jakub
More information about the Fortran
mailing list