[Patch, Fortran] Another floating point speedup

Daniel Kraft d@domob.eu
Tue Jan 6 08:37:00 GMT 2009


Dominique Dhumieres wrote:
> I don't know if this is a NIST bug or not, but the two following
> tests are no longer working with the Daniel's patch (derived from
> FM110 and FM900):

Hi Dominique,

you were right here, there was a problem with exponents without the 'e'; 
the updated patch fixes this.  It gives the expected result for your 
second test (read_float_3.f90 in the patch) but the value read with g in 
your first test (read_float_2.f03) does not match the expected one, 
although no error is issued.  I don't know why this is at the moment, 
but have nearly no knowledge about g-formatting at all...

We may want to check for the expected values in the patch, too.

Thanks for the tests,
Daniel

> character(15) :: str="+ .339  567+2"
> real :: x
> read(str,'(BN,F15.6)') x
> print *, x
> read(str,'(G15.7)') x
> print *, x
> end
> 
> [ibook-dhum] f90/bug% gfc read_tst_1.f90
> [ibook-dhum] f90/bug% a.out
> At line 3 of file read_tst_1.f90
> Fortran runtime error: Bad value during floating point read
> [ibook-dhum] f90/bug% gfortran read_tst_1.f90
> [ibook-dhum] f90/bug% a.out
>    33.956699    
>    33.956699    
> 
> character(100) :: str1="123.00456.88 0.123E+01  +0.987+1 -0.2345+02 -0.6879E+2+0.7E+03 0.4E+03" 
> complex :: c1, c2, c3, c4
> read (str1,'( 2F6.2, 2E10.3, 2E11.4, 2E8.1)') c1, c2, c3, c4
> print *, c1, c2, c3, c4
> end
> 
> [ibook-dhum] f90/bug% gfc read_tst_3.f90
> [ibook-dhum] f90/bug% a.out
> At line 3 of file read_tst_3.f90
> Fortran runtime error: Bad value during floating point read
> [ibook-dhum] f90/bug% gfortran read_tst_3.f90
> [ibook-dhum] f90/bug% a.out
>  (  123.00000    ,  456.88000    ) (  1.2300000    ,  9.8699999    ) ( -23.450001    , -68.790001    ) (  700.00000    ,  400.00000    )
> 
> I did not check the standard to know if the E/F/G formats use BN
> by default, but I think the two codes are valid and give the
> expected outputs with gfortran.
> 
> Cheers
> 
> Dominique
> 


-- 
Done:  Arc-Bar-Cav-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri-Ran
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20090106/c689386b/attachment.ksh>


More information about the Fortran mailing list