Next: Bitwise Operations, Previous: Scientific, Up: Numbers
Many of Guile's numeric procedures which accept any kind of numbers as arguments, including complex numbers, are implemented as Scheme procedures that use the following real number-based primitives. These primitives signal an error if they are called with complex arguments.
Return x raised to the power of y. This procedure does not accept complex arguments.
Return the arc tangent of the two arguments x and y. This is similar to calculating the arc tangent of x / y, except that the signs of both arguments are used to determine the quadrant of the result. This procedure does not accept complex arguments.
Return e to the power of x, where e is the base of natural logarithms (2.71828...).
For the hyperbolic arc-functions, the Guile library exports C functions
corresponding to these Scheme procedures, but taking and returning
arguments of type double rather than the usual SCM.
Return the hyperbolic arcsine, arccosine or arctangent of x respectively.
For all the other Scheme procedures above, except expt and
atan2 (whose entries specifically mention an equivalent C
function), the equivalent C functions are those provided by the standard
mathematics library. The mapping is as follows.
| Scheme Procedure | C Function
| |
$abs | fabs
| |
$sqrt | sqrt
| |
$sin | sin
| |
$cos | cos
| |
$tan | tan
| |
$asin | asin
| |
$acos | acos
| |
$atan | atan
| |
$exp | exp
| |
$log | log
| |
$sinh | sinh
| |
$cosh | cosh
| |
$tanh | tanh
|
Naturally, these C functions expect and return double arguments.