Mikroelektronika MIKROE-724 データシート

ページ / 726
688
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
exp
Prototype
sub function exp(dim x as float) as float
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 float) as float
Description Function returns the absolute (i.e. positive) value of 
d
.
Example
res = fabs(-1.3)  ‘ res = 1.3
floor
Prototype
sub function floor(dim x as float) as float
Description Function returns the value of parameter x rounded down to the nearest integer.
Example
res = floor(15.258)  ‘ res = 15.000000
frexp
Prototype
sub function frexp(dim value as float, dim byref eptr as integer) as float
Description The function splits a floating-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 float, dim newexp as integer) as float
Description Function returns the result of multiplying the floating-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 float) as float
Description Function returns the natural logarithm of 
x
 (i.e. 
log
e
(x)
).
Example
res = log(10)  ‘ res = 2.302585E