sign

Date:

02-06-2023

NAME

SIGN, DSIGN, ISIGN, IISIGN, JISIGN, KISIGN - Transfer the sign of numbers

SYNOPSIS

SIGN ([A=]a,[B=]b)
DSIGN ([A=]a,[B=]b)
ISIGN ([A=]a,[B=]b)
IISIGN ([A=]a,[B=]b)
JISIGN ([A=]a,[B=]b)
KISIGN ([A=]a,[B=]b)

STANDARDS

Fortran

Fortran extensions: ISIGN, IISIGN, JISIGN, KISIGN, DSIGN

DESCRIPTION

These intrinsics transfer the sign of b to a. SIGN is the generic function name; the others are specifics. These are elemental intrinsic functions. They accept the following arguments:

a

Must be of type integer or real. If a is zero, the result is zero for SIGN, ISIGN, and DSIGN.

b

Must be of the same type and kind type as a.

These functions evaluate one of the following equations, depending on the sign of the number:

y = |a|, if b >= 0

or

y = -|*a*|, if b < 0

SIGN transfers the sign from one real number to another.

ISIGN transfers the sign from one integer (KIND=2 or KIND=4) to another.

IISIGN transfers the sign from one integer (KIND=2) to another.

JISIGN transfers the sign from one integer (KIND=4) to another.

KISIGN transfer the sign from one integer (KIND=8) to another.

DSIGN transfers the sign from one double-precision real number to another.

The SIGN, ISIGN, and DSIGN intrinsic function names can be passed as arguments; the other cannot.