Fortran test cases
Benson Muite
benson_muite@emailplus.org
Tue Jan 22 05:59:00 GMT 2019
On 01/22/2019 07:06 AM, Steve Kargl wrote:
> On Tue, Jan 22, 2019 at 06:17:14AM +0200, Benson Muite wrote:
>> Hi,
>>
>> Have recently found that when using an installation of gcc gfortran
>> 8.1.1 and 8.2.1, the double precision computation of sine function can
>> return a single precision result. The program
>>
>> PROGRAM testsin
>> real(kind=8) :: pi=3.14159265358979
>
> 3.14159265358979 is a single precision number.
>
There are 14 places after the decimal one can add further digits of pi,
the result is the same. Single precision gives results within 7 digits
after the decimal
(https://en.wikipedia.org/wiki/Single-precision_floating-point_format)
double precision should give results within 14 digits after the decimal
(https://en.wikipedia.org/wiki/Double-precision_floating-point_format)
More information about the Fortran
mailing list