User guide

3.3. GLOBAL FUNCTIONS 65
time of the last modification of the file given by name returning TRUE if successful.
The first element datv!0 holds the number of days since 1 January 1970, datv!1 is the
number of mil l i -se c onds since midnight and datv!2=-1 indicating that the new date
format is being used. If the file does not exist the call returns FALSE and setting the
three elements of datv to 0, 0 and -1, respectively.
res := sys(Sys filesize, fd) CIN:y, POS:y, NAT:y
This call return the size in bytes of the currently opened disk file whose file descrip-
tor is fd. The file descriptor is typically obtained by t he expression scb!scb
fd.
res := sys(Sys
flt, op ,... ) CIN:y, POS:y, NAT:y
This call provides all the floating point operations available to BCPL. The required
operation is s pecified by op normally using a manifest constant (declared in libhdr)
such as fl
mk, fl plus or fl sin. All such operations are described below. BCPL
floating point numbers must fit in BCPL words and so are typicall y only 32 bits long
causing their precision and range to be somewhat l i mi te d. On 64-bit implementations
of BCPL, fl oati ng point numbers are much more precise.
res := sys(Sys flt, fl avail) CIN:y, POS:y, NAT:y
This call attempts returns -1 if all the Sys
flt operations are available. It otherwise
return zero.
res := sys(Sys
flt, fl mk, a, e) CIN:y, POS:y, NAT:y
This call attempts to return a floating point approximimation to the number a×10
e
where a and e are signed integers.
res := sys(Sys
flt, fl unmk, a) CIN:y, POS:y, NAT:y
This call decomposes the floating point number a returning the signed integer
mantissa and leaving the decimal e x ponent in result2. For example, sys(Sys
flt,
fl
unmk, 1234.5678) might return 12345678 leaving -4 in result2. However, the
result may vary depending on the BCPL word length and the floating point represen-
tation used.
res := sys(Sys
flt, fl float, a)
res := sys(Sys
flt, fl fix, a) CIN:y, POS:y, NAT:y
The first call returns a floating point approximation of the integer a, and the second
attempts to return the closest integer to the floating point number a.
res := sys(Sys
flt, fl abs, a)
res := sys(Sys
flt, fl pos, a)
res := sys(Sys
flt, fl neg, a)
res := sys(Sys
flt, fl mul, a, b)
res := sys(Sys
flt, fl div, a, b)
res := sys(Sys
flt, fl add, a, b)
res := sys(Sys
flt, fl sub, a, b) CIN:y, POS:y, NAT:y
The first three calls return, respectively, the absolute value of a, the value of a and