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