User guide
3.3. GLOBAL FUNCTIONS 67
res := sys(Sys
flt, fl modf, a)
res := sys(Sys
flt, fl fmod, x, y) CIN:y, POS:y, NAT:y
The first call returns the fractional part (f) of a storing the integer part (i) as a
floating-point numb e r in result2. The sign of both f and i is the same as the sign of
a and a will equal i + f.
The second call returns f such that f has the same sign as x , the absolute value of
f is less than the absol ut e value of y, and there exists and integer k such that k × y + f
equals x.
res := sys(Sys
flt, fl pow, a, b)
res := sys(Sys
flt, fl sqrt, a) CIN:y, POS:y, NAT:y
The first call returns an approximation to a
b
, and the second call attempts to return
the non negative square root of a.
res := sys(Sys
flt, fl ceil, a)
res := sys(Sys
flt, fl floor, a) CIN:y, POS:y, NAT:y
The first cal l ret ur ns the smalle st floating- point number not less than a whose value
is an exact integer and the second call returns the largest floating-point number not
greater than a whose value is an exact i nteger.
res := sys(Sys
flt, fl F2N, s, x) CIN:y, POS:y, NAT:y
This returns the integer part of s × x. This is the scale d fixed point representation
of x when s is the scaled value representing 1.0. For example:
sys(Sys_flt, fl_F2N, 1_000, 1.234) = 1_234
res := sys(Sys flt, fl N2F, s, n) CIN:y, POS:y, NAT:y
This retur ns the floating point value corresponding to n/s. This is the floating
point number representing the fix e d point scaled value n when the scaled number s
represents 1.0. For example:
sys(Sys_flt, fl_N2F, 1_000, 1_234) = 1.234
res := sys(Sys
flt, fl radius2, a, b)
res := sys(Sys
flt, fl radius3, a, b, c) CIN:y, POS:y, NAT:y
The first call returns the square root of a
2
+ b
2
and the second returns the square
root of a
2
+ b
2
+ c
2
.
sys(Sys
freevec, ptr) CIN:y, POS:y, NAT:y
If ptr is zero it does nothing, otherwise it returns to fre e store the spac e pointed to
by ptr which must have previously been allocated by sys(Sys
getvec,...). It checks
that the block is not already fr e e and atte mpt to check that it has not been corrupted.
res := sys(Sys getpid) CIN:y, POS:y, NAT:y
This function returns the process id of the currently executing process.