Vous êtes sur la page 1sur 3

Some Common Library Functions in FORTRAN Language

Name & Form Mode of Mode of Purpose


Argument Result
ABS(a) Real Real Returns the
IABS(i) Integer Integer absolute value of
an argument
AINT(a) Real Real Returns the value
of an argument
after truncation
ALOG(a) Real Real Returns the natural
algorithm of an
argument
ALOG10(a) Real Real Returns the base-
10 algorithm of an
argument
MAXO(I,j,k,…) Integer Integer Returns the value
AMAXI(a,b,c,…) Real Real of the largest
argument
MINO(I,j,k,…) Integer Integer Returns the value
AMINI(a,b,c,…) Real Real of the smallest
argument
DIM(a,b,…) Real Real Returns the +ve
IDIM(I,j,…) Integer Integer difference of two
arguments (a – b);
if a<b, DIM(a,)=0.0
EXP(a) Real Real Returns the
exponential of an
argument (ea)
FLOAT(i) Integer Real Returns the real
equivalent of an
integer argument
IFIX(a) or INT(a) Real Integer Returns the integer
from a real
argument
ICHAR(a) Character Integer Returns an integer
value from a
character argument
CHAR(i) Integer Character Returns a character
value from a
integer argument
LEN(a) Character Integer Returns the length
of the character
string
AMOD(a) Real Real Returns the
MOD(I,j) Integer Integer remainder of a
divided by b
NINT(a) Real Integer Returns the nearest
integer
SQRT(a) Real Real Returns the square
root of an argument
DATE() ― Character Returns the current
date
TIME() Returns the current
CLOCK() ― Character reading of the
system clock
RANF() ― Real Returns a random
number between
0.0 and 1.0

Some Common Library Functions in BASIC Language


Function Application Description
ABS 10 LET Y=ABS(X) Calculate the absolute
value of x; y=|x|
ATN 10 LET Y=ATN(X) Calculate the arctangent
of x; y=arctan(x)
COS 10 LET Y=COS(X) Calculate the cosine of
x; y=cos(x), x in radians
COT 10 LET Y=COT(X) Calculate the cotangent
of x; y=cot(x), x in
radians
EXP 10 LET Y=EXP(X) Raise e to the x power;
y=ex
INT 10 LET Y=INT(X) Assign to y the largest
integer that
algebraically does not
exceed x
LOG 10 LET Y=LOG(X) Calculate the natural
logarithm of x; y=logex,
x>0
SGN 10 LET Y=SGN(X) Determine the sign of x
(y = +1 if x is positive, y
= 0 if x = 0, y = -1 if x is
negative)
SIN 10 LET Y=SIN(X) Calculate the sine of x, y
= sin(x), x in radians
SQR 10 LET Y=SQR(X) Calculate the square
root of x; y = √x, x>0
TAB 20 PRINT TAB(N);X Causes the value of x to
be printed or displayed
at column n. (Left
column is considered
column 0)
TAN 10 LET Y=TAN(X) Calculate the tangent of
x; y = tan(x), x in
radians

Vous aimerez peut-être aussi