integer procedure rem(a, b); integer a, b;
rem := The remainder of dividing a by b
<type of arg> procedure abs(arg); < arithmetical type > arg;
abs := if arg < 0 then -arg else arg;
integer procedure sign(a); <arithmetical type> a;
sign := if a < 0 then -1 else if a = 0 then 0 else 1;
integer procedure entier(a); real a;
entier := < the largest integer less than or equal to a >
integer procedure mod(a, b); integer a, b;
mod := < a modulo b >;
<type> procedure min(a, b); <type> a, b;
min := < the smaller of a and b >;
<type> procedure max(a, b); <type> a, b;
max := < the larger of a and b >;
Legal
parameter types for MAX and MIN are text, character,
real-type and integer-type.
integer procedure upperbound(arr, dim);
<type> array arr;
integer dim;
upperbound := < the upper bound for the array in dimension dim >;
integer procedure lowerbound(arr, dim);
<type> array arr;
integer dim;
lowerbound:= < the lower bound for the array in dimension dim >;
text procedure datetime;
datetime :- copy( text with the format "YYYY-MM-DD HH:MM:SS.ssss");
long real procedure cputime;
cputime := the number of processor seconds used by the program
long real procedure clocktime;
clocktime := < the number of seconds since midnight >
text procedure copy(t); text t;
copy :- a copy of the text object referenced by t
text procedure blanks(n); integer nl-
blanks :- a text object containing n blanks
character procedure char(n); integer n;
char := < the character with Rank equal to n
in the locally used character sequence >;
character procedure isochar(n)- integer n;
isochar := < the character with Rank equal to n
in the ISO character sequence >;
integer procedure rank(c); character c;
rank := < the Rank of character c in the locally used
character sequence >;
integer procedure isorank(c); character c;
isorank := < the Rank of character c in the ISO
character sequence >;
boolean procedure digit(c); character c;
digit := < true if c is a decimal digit; false otherwise >;
boolean procedure letter(c); character c;
letter := < true if c is a letter; false otherwise >;
text procedure upcase(t); text t;
upcase :- < t after converting every letter in t to upper case >;
text procedure lowcase(t); text t;
lowcase :- < t after converting every letter in t to lower case >;
integer procedure maxint;
maxint := < the largest possible integer > ;
integer procedure minint;
minint := < the smallest possible integer > ;
real procedure maxreal;
maxreal := < the largest possible real >;
real procedure minreal;
minreal := < the smallest possible real >;
integer procedure maxrank;
maxrank := <number of characters in the locally used character
sequence> ;
<type of E> procedure addepsilon(E); <real-type> E;
addepsilon := E + < the smallest possible difference between two
reals >;
AddEpsilon provides the NEXT real value (if it exists) according to the local implementation of real numbers.
<type of E> procedure subepsilon(E); <real-type> E;
subepsilon := E - < the smallest possible difference between two
reals >;
SubEpsilon provides the PREVIOUS real value (if it exists) according to the local implementation of real numbers.
long real procedure maxlongreal;
maxlongreal := < the largest possible double precision real >;
long real procedure minlongreal;
minlongreal := < the smallest possible double precision real >;
text simulaid;
The value of this text bas the following format:
<simid>!!! <siteid>!!!<OS>!!!<CPU>!!!<user>!!!<job>!!!<acc>!!!<prog>
where
<simid> = Identification of the Simula system
<siteid>= Identification of the installation
<OS> = Identification of the operating system
<CPU> = Identification of the computer
<user> = Identification of the user
<job> = Identification of the job
<acc> = Identification of the account
<prog> = Identification of the program
Note
that the name of this procedure stands for SIMULA ID; and not SIMUL AID.
integer procedure sourceline;
sourceline := < the number of the program line in which the
invocation of this procedure occurs > ;
procedure error(t); text t;
displays the text t and stops the program
procedure terminate_program;
< Closes SYSIN and SYSOUT and then stops the program > ;
real procedure ln(r); real r;
ln := < the natural logarithm of r >
real procedure log10(r); real r;
log10 := < the base_10 logarithm of r
real procedure exp(r); real r;
exp := < e raised to the power of r >
real procedure sqrt(r); real r;
sqrt := < the square root of r >;
Note: In all the trigonometric functions which follow angles are measured in radians and angular results are between - pi/2 and pi/2 .
real procedure sin(r); real r;
sin := < the sine of r >;
real procedure cos(r); real r;
cos := < the cosine of r >;
real procedure tan(r); real r;
tan := < the tangent of r >;
real procedure cotan(r); real r;
cotan := < the cotangent of r
real procedure arcsin(r); real r;
arcsin := < the arcsine of r );
real procedure arccos(r); real r;
arccos : = the arccosine of r
real procedure arctan(r); real r;
arctan := the arctangent of r
real procedure sinh(r); real r;
sinh := the hyperbolic sine of r
real procedure tanh(r); real r;
tanh := < the hyperbolic tangent of r > ;
boolean procedure draw(p, seed);
name seed; real p; integer seed;
draw := true with probability p, false with probability (1 - p)
integer procedure randint(low, high, seed);
name seed; integer low, high, seed;
Randint
returns one of the integers in [ low, low + 1,... high] with equal probability.
long real procedure uniform(low, high, seed);
name seed; long real low, high; integer seed;
uniform := a value chosen uniformly on the interval [low .. high]
long real procedure normal(mean, stdv, seed);
name seed; long real mean, stdv; integer seed;
Normal
returns a value chosen so that, if the fonction is used a largenumber of times
with the same parameters, the values will bave an average value mean
with a standard deviation of stdv.Some additional and rather specialized predefined functions that may be used to draw numbers randomly are not described here.