[J3] branch based on ieee class ?

Anton Shterenlikht ashterenli at cray.com
Thu Nov 7 11:47:55 EST 2019



> On 7 Nov 2019, at 16:42, Vipul Parekh via J3 <j3 at mailman.j3-fortran.org> wrote:
> 
> Hello Dan,
> 
> See section 17.2 Derived types, constants, and operators defined in
> the modules in 18-007r1.pdf, p3 on IEEE_ARITHMETIC module,
> particularly lines 27 thru' 30 which state,
> 
> 27 * The pure elemental operator == for two values of one of these
> types to return true if the values are the
> 28   same and false otherwise.
> 29 * The pure elemental operator /= for two values of one of these
> types to return true if the values differ and
> 30   false otherwise.
> 
> From what I understand, you will have to construct your case using
> either of the above-mentioned operators e.g.,
> 
>   use, intrinsic :: ieee_arithmetic, only : ieee_class,
> ieee_negative_normal, operator(==)
>   real :: x
>   x = -1.0
>   if ( ieee_class(x) == ieee_negative_normal ) then
>      print *, "x is IEEE_NEGATIVE_NORMAL"
>   else
>      print *, "The IEEE class of x is not as expected!"
>   end if
> end

see e.g.

https://sourceforge.net/p/cmplx/svn/HEAD/tree/head/src/mtermacos.f90



More information about the J3 mailing list