Next: Prime Numbers, Previous: Irrational Integer Functions, Up: Mathematical Packages [Contents][Index]
(require 'math-real)
Although this package defines real and complex functions, it is safe to load into an integer-only implementation; those functions will be defined to #f.
These procedures are part of every implementation that supports
general real numbers; they compute the usual transcendental functions.
‘real-ln’ computes the natural logarithm of x;
‘real-log’ computes the logarithm of x base y, which
is (/ (real-ln x) (real-ln y))
. If arguments x and
y are not both real; or if the correct result would not be real,
then these procedures signal an error.
For non-negative real x the result will be its positive square root; otherwise an error will be signaled.
Returns x1 raised to the power x2 if that result is a real number; otherwise signals an error.
(real-expt 0.0 x2)
x2 should be non-zero.
(quo x1 x2) ==> n_q (rem x1 x2) ==> x_r (mod x1 x2) ==> x_m
where n_q is x1/x2 rounded towards zero, 0 < |x_r| < |x2|, 0 < |x_m| < |x2|, x_r and x_m differ from x1 by a multiple of x2, x_r has the same sign as x1, and x_m has the same sign as x2.
From this we can conclude that for x2 not equal to 0,
(= x1 (+ (* x2 (quo x1 x2)) (rem x1 x2))) ==> #t
provided all numbers involved in that computation are exact.
(quo 2/3 1/5) ==> 3 (mod 2/3 1/5) ==> 1/15 (quo .666 1/5) ==> 3.0 (mod .666 1/5) ==> 65.99999999999995e-3
These procedures are part of every implementation that supports general real numbers. ‘Ln’ computes the natural logarithm of z
In general, the mathematical function ln is multiply defined. The value of ln z is defined to be the one whose imaginary part lies in the range from -pi (exclusive) to pi (inclusive).
For real argument x, ‘Abs’ returns the absolute value of x’ otherwise it signals an error.
(abs -7) ==> 7
These procedures are part of every implementation that supports general complex numbers. Suppose x1, x2, x3, and x4 are real numbers and z is a complex number such that
Then
(make-rectangular x1 x2) ==> z (make-polar x3 x4) ==> z
where -pi < x_angle <= pi with x_angle = x4 + 2pi n for some integer n.
If an argument is not real, then these procedures signal an error.
Next: Prime Numbers, Previous: Irrational Integer Functions, Up: Mathematical Packages [Contents][Index]