The compnums are the subset of the inexact complex numbers whose real part and imaginary part are both flonums. This library is based on the R6RS flonum library lifted to compnums, except that the R6RS-specific integer division procedures have been removed, as have the condition types, and a few procedures have been added from the C99 <complex.h> library.

This section uses *cx*, *cx _{1}*,

This is not a procedure, but the compnum 0.0+1.0i.

The value returned is a compnum that is numerically closest to
*x*. This procedure can be used to transform a flonum to a compnum.

The value returned is a compnum whose real part is the flonum *fl _{1}* and whose imaginary part is the flonum

The value returned is a compnum whose magnitude is the flonum *fl _{1}*
and whose angle is the flonum

Returns `#t` if *obj* is a compnum, `#f` otherwise.

This procedure returns `#t` if its arguments are equal.

These numerical predicates test a compnum for a particular property,
returning `#t` or `#f`.
The `cxzero?` procedure tests whether
it is `cx=?` to `0.0+0.0i,
cxfinite? tests whether both the real and the imaginary parts
are not an infinity and not a NaN,
cxinfinite? tests whether either the real or the imaginary parts or both is an infinity, and
cxnan? tests whether either the real part or the imaginary part or both is a NaN.`

These procedures return the compnum sum or product of their compnum arguments. In general, they should return the compnum that best approximates the mathematical sum or product. (For implementations that represent compnums using IEEE binary floating point, the meaning of “best” is defined by the IEEE standards.)

With two or more arguments, these procedures return the compnum difference or quotient of their compnum arguments, associating to the left. With one argument, however, they return the additive or multiplicative compnum inverse of their argument. In general, they should return the compnum that best approximates the mathematical difference or quotient. (For implementations that represent compnums using IEEE binary floating point, the meaning of “best” is reasonably well-defined by the IEEE standards.)

For undefined quotients, `cx/` behaves as specified by the
IEEE standards

This procedure returns the real part of *cx* as a flonum.

This procedure returns the imaginary part of *cx* as a flonum.

This procedure returns the nearest approximation to the angle of *cx* that is a flonum.

These procedures return the nearest approximation to the absolute value (magnitude)
of *cx* that is a compnum.

This procedure returns the complex conjugate
of *cx*. The result has the same as the real part of *cx*. Its imaginary part
is the negation of the imaginary part of *cx*.

This procedure returns the Riemann projection
of *cx*. This is the same as *cx* unless *cx* has an infinite real part
or complex part. In this case, the result is a compnum whose real part is 0.0 and whose
imaginary part is either 0.0 or -0.0, depending on the sign of the imaginary part of *cx*.

This procedure returns a complex number whose phase is the same as *z* but whose magnitude is 1,
unless *z is zero, in which case it returns z.
*

These procedures compute the usual transcendental functions.
The `cxexp` procedure computes the base-*e* exponential of *cx*.
The `cxlog` procedure with a single argument computes the natural logarithm of
*cx* (not the base ten logarithm); `(cxlog cx_{1}
cx_{2})` computes the base-

See the corresponding section of R^{7}RS-small for the underlying
mathematical operations.

Implementations that use IEEE binary floating-point arithmetic should follow the relevant standards for these procedures.

Returns the principal square root of *cx*..

Either *cx _{1}* should be non-negative, or, if