Warning: This is the manual of the legacy Guile 2.0 series. You may want to read the manual of the current stable series instead.

Next: , Previous: , Up: Numbers   [Contents][Index]

#### 6.6.2.10 Complex Number Operations

Scheme Procedure: make-rectangular real_part imaginary_part
C Function: scm_make_rectangular (real_part, imaginary_part)

Return a complex number constructed of the given real-part and imaginary-part parts.

Scheme Procedure: make-polar mag ang
C Function: scm_make_polar (mag, ang)

Return the complex number mag * e^(i * ang).

Scheme Procedure: real-part z
C Function: scm_real_part (z)

Return the real part of the number z.

Scheme Procedure: imag-part z
C Function: scm_imag_part (z)

Return the imaginary part of the number z.

Scheme Procedure: magnitude z
C Function: scm_magnitude (z)

Return the magnitude of the number z. This is the same as `abs` for real arguments, but also allows complex numbers.

Scheme Procedure: angle z
C Function: scm_angle (z)

Return the angle of the complex number z.

C Function: SCM scm_c_make_rectangular (double re, double im)
C Function: SCM scm_c_make_polar (double x, double y)

Like `scm_make_rectangular` or `scm_make_polar`, respectively, but these functions take `double`s as their arguments.

C Function: double scm_c_real_part (z)
C Function: double scm_c_imag_part (z)

Returns the real or imaginary part of z as a `double`.

C Function: double scm_c_magnitude (z)
C Function: double scm_c_angle (z)

Returns the magnitude or angle of z as a `double`.