The ABS function returns the absolute value of a numeric argument.

## Syntax

ABS (a)

*a* is an INTENT(IN) scalar or array of type REAL, INTEGER, or COMPLEX.

If a is INTEGER or REAL, the result is the same type and kind as a and has the value |a|.

If *a* is COMPLEX with value (x,y), the result is a REAL value with the same kind as a, and

is a representation of

real :: y=-4.5 complex :: z=(1.,-1.) write(*,*) abs(y) ! writes 4.5000000 write(*,*) abs(z) ! writes 1.4142135