sign(3I)

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

As shipped in IRIX 6.5.30. Last changed in IRIX 6.5.19.

NAME
     SIGN, DSIGN, QSIGN, ISIGN, IISIGN, JISIGN, KISIGN - Transfers the sign
     of numbers

SYNOPSIS
     SIGN ([A=]a,[B=]b)
     DSIGN ([A=]a,[B=]b)
     QSIGN ([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, QSIGN

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, DSIGN, and QSIGN.

     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.

     QSIGN transfers the sign from one quad-precision real number to
     another.

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

EXAMPLES
     The SIGN intrinsic function yields differing values depending on your
     platform, as follows:

     * SIGN(-1.0,-.0) yields 1.0.

     * If the program is compiled with the -LANG:IEEE_minus_zero=ON option,
       SIGN(-1.0,-.0) yields -1.0.