Fortran - Intrinsic Functions

Intrinsic functions are some common and important functions that are provided as a part of the Fortran language. We have already discussed some of these functions in the Arrays, Characters and String chapters.

Intrinsic functions can be categorised as −

We have discussed the array functions in the Arrays chapter. In the following section we provide brief descriptions of all these functions from other categories.

In the function name column,

Numeric Functions

Sr.No Function & Description
1

ABS (A)

It returns the absolute value of A

2

AIMAG (Z)

It returns the imaginary part of a complex number Z

3

AINT (A [, KIND])

It truncates fractional part of A towards zero, returning a real, whole number.

4

ANINT (A [, KIND])

It returns a real value, the nearest integer or whole number.

5

CEILING (A [, KIND])

It returns the least integer greater than or equal to number A.

6

CMPLX (X [, Y, KIND])

It converts the real variables X and Y to a complex number X+iY; if Y is absent, 0 is used.

7

CONJG (Z)

It returns the complex conjugate of any complex number Z.

8

DBLE (A)

It converts A to a double precision real number.

9

DIM (X, Y)

It returns the positive difference of X and Y.

10

DPROD (X, Y)

It returns the double precision real product of X and Y.

11

FLOOR (A [, KIND])

It provides the greatest integer less than or equal to number A.

12

INT (A [, KIND])

It converts a number (real or integer) to integer, truncating the real part towards zero.

13

MAX (A1, A2 [, A3,...])

It returns the maximum value from the arguments, all being of same type.

14

MIN (A1, A2 [, A3,...])

It returns the minimum value from the arguments, all being of same type.

15

MOD (A, P)

It returns the remainder of A on division by P, both arguments being of the same type (A-INT(A/P)*P)

16

MODULO (A, P)

It returns A modulo P: (A-FLOOR(A/P)*P)

17

NINT (A [, KIND])

It returns the nearest integer of number A

18

REAL (A [, KIND])

It Converts to real type

19

SIGN (A, B)

It returns the absolute value of A multiplied by the sign of P. Basically it transfers the of sign of B to A.