ieee_is_negative

Date:

10-12-2011

NAME

IEEE_IS_NEGATIVE - Tests if x is negative

SYNOPSIS

IEEE_IS_NEGATIVE ([X=]x)

IMPLEMENTATION

Cray Linux Environment (CLE)

STANDARDS

Fortran

IEEE Standard for Binary Floating-point Arithmetic

DESCRIPTION

The IEEE_IS_NEGATIVE intrinsic function returns the value TRUE if x is negative. Otherwise, it returns the value FALSE.

IEEE_IS_NEGATIVE accepts the following argument:

x

Must be of type real.

IEEE_IS_NEGATIVE is an elemental function. The name of this intrinsic cannot be passed as an argument.

IEEE_IS_NEGATIVE will not be invoked if IEEE_SUPPORT_DATATYPE(X) has the value false.

NOTES

The IEEE intrinsic procedures use the named constants contained in a system module, so you must include the following statement in your program:

USE, INTRINSIC :: IEEE_ARITHMETIC

RETURN VALUES

The result type and type parameter is default logical.

The result has the value true if the value of x is negative. That is, the IEEE_CLASS(x) must be one of the following values:

  • IEEE_NEGATIVE_DENORMAL

  • IEEE_NEGATIVE_INF

  • IEEE_NEGATIVE_NORMAL

  • IEEE_NEGATIVE_ZERO

Otherwise, the result has the value false.

EXAMPLES

Example 1:

USE, INTRINSIC :: IEEE_ARITHMETIC
REAL   x
   ! Compute X.
IF (IEEE_IS_NEGATIVE(x)) THEN
   ! Do something.
ELSE
   ! Do something else.
END IF

SEE ALSO

ieee_suppport_datatype(3i)