Trigon Library
The mikroPascal PRO for dsPIC30/33 and PIC24 provides a set of library functions for floating point math handling. See also Predefined Globals and Constants for the list of predefined math constants.
Library Functions
- acos
- asin
- atan
- atan2
- ceil
- cos
- cosh
- eval_poly
- exp
- fabs
- floor
- frexp
- ldexp
- log
- log10
- modf
- pow
- sin
- sinh
- sqrt
- tan
- tanh
acos
Prototype |
function acos(x : real) : real; |
---|---|
Description |
Function returns the arc cosine of parameter |
Example |
res := acos(0.5); // res := 1.047198 |
asin
Prototype |
function asin(x : real) : real; |
---|---|
Description |
Function returns the arc sine of parameter |
Example |
res := asin(0.5); // res := 5.235987e-1 |
atan
Prototype |
function atan(arg : real) : real; |
---|---|
Description |
Function computes the arc tangent of parameter |
Example |
res := atan(1.0); // res := 7.853982e-1 |
atan2
Prototype |
function atan2(y : real; x : real) : real; |
---|---|
Description |
This is the two-argument arc tangent function. It is similar to computing the arc tangent of |
Example |
res := atan2(2., 1.); // res := 4.636475e-1 |
ceil
Prototype |
function ceil(x : real) : real; |
---|---|
Description |
Function returns value of parameter |
Example |
res := ceil(0.5); // res := 1.000000 |
cos
Prototype |
function cos(arg : real) : real; |
---|---|
Description |
Function returns the cosine of |
Example |
res := cos(PI/3.); // res := 0.500008 |
cosh
Prototype |
function cosh(x : real) : real; |
---|---|
Description |
Function returns the hyperbolic cosine of |
Example |
res := cosh(PI/3.); // res := 1.600286 |
eval_poly
Prototype |
function eval_poly(x : real; var d : array[10] of real; n : byte) : real; |
---|---|
Description |
Function Calculates polynom for number |
exp
Prototype |
function exp(x : real) : real; |
---|---|
Description |
Function returns the value of e — the base of natural logarithms — raised to the power |
Example |
res := exp(0.5); // res := 1.648721 |
fabs
Prototype |
function fabs(d : real) : real; |
---|---|
Description |
Function returns the absolute (i.e. positive) value of |
Example |
res := fabs(-1.3); // res := 1.3 |
floor
Prototype |
function floor(x : real) : real; |
---|---|
Description |
Function returns the value of parameter |
Example |
res := floor(15.258); // res := 15.000000 |
frexp
Prototype |
function frexp(value : real; var eptr : integer) : real; |
---|---|
Description |
The function splits a floating-point value |
ldexp
Prototype |
function ldexp(value : real; newexp : integer) : real; |
---|---|
Description |
Function returns the result of multiplying the floating-point number |
Example |
res := ldexp(2.5, 2); // res := 10 |
log
Prototype |
function log(x : real) : real; |
---|---|
Description |
Function returns the natural logarithm of |
Example |
res := log(10); // res := 2.302585E |
log10
Prototype |
function log10(x : real) : real; |
---|---|
Description |
Function returns the base-10 logarithm of |
Example |
res := log10(100.); // res := 2.000000 |
modf
Prototype |
function modf(val : real; var iptr : real) : real; |
---|---|
Description |
Returns argument |
Example |
res := modf(6.25, iptr); // res := 0.25, iptr = 6.00 |
pow
Prototype |
function pow(x : real; y : real) : real; |
---|---|
Description |
Function returns the value of |
Example |
res := pow(10.,5.); // res := 9.999984e+4 |
sin
Prototype |
function sin(arg : real) : real; |
---|---|
Description |
Function returns the sine of |
Example |
res := sin(PI/2.); // res := 1.000000 |
sinh
Prototype |
function sinh(x : real) : real; |
---|---|
Description |
Function returns the hyperbolic sine of |
Example |
res := sinh(PI/2.); // res := 2.301296 |
sqrt
Prototype |
function sqrt(x : real) : real; |
---|---|
Description |
Function returns the non negative square root of |
Example |
res := sqrt(10000.); // res := 100.0000 |
tan
Prototype |
function tan(x : real) : real; |
---|---|
Description |
Function returns the tangent of |
Example |
res := tan(PI/4.); // res := 0.999998 |
tanh
Prototype |
function tanh(x : real) : real; |
---|---|
Description |
Function returns the hyperbolic tangent of |
Example |
res := tanh(-PI/4.); // res := -0.655793 |
What do you think about this topic ? Send us feedback!