Fortran test cases
Benson Muite
benson_muite@emailplus.org
Wed Jan 23 06:49:00 GMT 2019
On 01/22/2019 08:28 PM, Thomas Koenig wrote:
> Hi,
>
>> PROGRAM testsin
>> Â Â real(kind=8) :: pi=3.14159265358979
>> Â Â real(kind=8) :: out
>>
>> Â Â out = dsin(pi)
>> Â Â print *,out
>> END PROGRAM testsin
>
> Just an additional data point.
>
> If you run this with -Wconversion -Wconversion-extra, you will get
>
> testsin.f90:2:20:
>
> Â Â Â 2 |Â real(kind=8) :: pi=3.14159265358979
> Â Â Â Â Â |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1
> Warning: Conversion from 'REAL(4)' to 'REAL(8)' at (1) [-Wconversion-extra]
> testsin.f90:2:36:
>
> Â Â Â 2 |Â real(kind=8) :: pi=3.14159265358979
> Â Â Â Â Â |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â 1
> Warning: Non-significant digits in 'REAL(4)' number at (1), maybe
> incorrect KIND [-Wconversion-extra]
>
> so the compiler has a facility to help you detect such errors.
>
> Regards
>
> Â Â Â Â Thomas
Thanks.
More information about the Fortran
mailing list