User manual
688
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
exp
Prototype
sub function exp(dim x as oat) as oat
Description Function returns the value of e — the base of natural logarithms — raised to the power x (i.e. e
x
).
Example
res = exp(0.5) ‘ res = 1.648721
fabs
Prototype
sub function fabs(dim d as oat) as oat
Description Function returns the absolute (i.e. positive) value of d.
Example
res = fabs(-1.3) ‘ res = 1.3
oor
Prototype
sub function oor(dim x as oat) as oat
Description Function returns the value of parameter x rounded down to the nearest integer.
Example
res = oor(15.258) ‘ res = 15.000000
frexp
Prototype
sub function frexp(dim value as oat, dim byref eptr as integer) as oat
Description The function splits a oating-point value value into a normalized fraction and an integral power of 2.
The return value is a normalized fraction and the integer exponent is stored in the object pointed to by
eptr.
ldexp
Prototype
sub function ldexp(dim value as oat, dim newexp as integer) as oat
Description Function returns the result of multiplying the oating-point number num by 2 raised to the power n (i.e.
returns x * 2
n
).
Example
res = ldexp(2.5, 2) ‘ res = 10
log
Prototype
sub function log(dim x as oat) as oat
Description Function returns the natural logarithm of x (i.e. log
e
(x)).
Example
res = log(10) ‘ res = 2.302585E