Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n | |||
integer, | intent(in) | :: | oldsign | |||
logical, | intent(in) | :: | x |
ELEMENTAL FUNCTION sgn(n, oldsign, x) RESULT(val) INTEGER, INTENT(IN) :: n, oldsign LOGICAL, INTENT(IN) :: x INTEGER :: val IF (.NOT. x) THEN val = SIGN(n, oldsign) ELSE val = -SIGN(n, oldsign) END IF END FUNCTION sgn