Next: SIGNAL, Previous: SHAPE, Up: Intrinsic Procedures
SIGN
— Sign copying functionSIGN(A,B)
returns the value of A with the sign of B.
RESULT = SIGN(A, B)
A | Shall be of type INTEGER or REAL
|
B | Shall be of the same type and kind as A
|
ABS(A)
, else
it is -ABS(A)
.
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
Name | Arguments | Return type | Standard
|
ISIGN(A,P) | INTEGER(4) | INTEGER(4) | f95, gnu
|
DSIGN(A,P) | REAL(8) | REAL(8) | f95, gnu
|