SIGN(3f)

DESCRIPTION
SIGN(A,B) returns the value of A with the sign of B.

STANDARD
Fortran 77 and later

CLASS
Elemental function

SYNTAX
RESULT = SIGN(A, B)

ARGUMENTS

A Shall be of type INTEGER or REAL B Shall be of the same type and kind as A

RETURN VALUE
The kind of the return value is that of A and B. If B 0 then the result is ABS(A), else it is -ABS(A).

EXAMPLE
          program test_sign
            print *, sign(-12,1)
            print *, sign(-12,0)
            print *, sign(-12,-1)

            print *, sign(-12.,1.)
            print *, sign(-12.,0.)
            print *, sign(-12.,-1.)
          end program test_sign

SPECIFIC NAMES

Name Arguments Return type Standard SIGN(A,B) REAL(4) A, B REAL(4) f77, gnu ISIGN(A,B) INTEGER(4) A, B INTEGER(4) f77, gnu DSIGN(A,B) REAL(8) A, B REAL(8) f77, gnu

AUTHOR

This information was taken from the GFortran documentation (https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/) and converted to a manpage by AstroFloyd (http://astrofloyd.org).