Unexpected NaN value

Luca Donatini lucadonatini.k@gmail.com
Thu Oct 4 21:17:00 GMT 2018


Dear Thomas,

Many thanks for the clarification!


Best regards,


Luca

Il gio 4 ott 2018, 22:30 Thomas Koenig <tkoenig@netcologne.de> ha scritto:

> Hi Luca,
>
> > program test
> >      implicit none
> >
> >      real :: a = -1.57079637
> >      real :: b = 2.1
> >
> >      write(*,*) cos(a)
> >      write(*,*) cos(a) **(2*b)
> >
> > end program
>
> cos(a) happens to be negative, so cos(a)**(2*b) is undefined,
> because 2*b is real.  And yes, this is expected.
>
> Regards
>
>         Thomas
>



More information about the Fortran mailing list