diff --git a/CHANGES b/CHANGES index 068fa9f..696d0bb 100644 --- a/CHANGES +++ b/CHANGES @@ -148,6 +148,9 @@ The following are the changes from calc version 2.14.3.5 to date: a COMPLEX value that is real (imag part is 0) into a NUMBER and optionally free the COMPLEX value. The func.c code now uses c_to_q(). + Added q_to_c(NUMBER *q) to make it easier to convert a NUMBER + into an allocated COMPLEX value. + Added new vercos(x, [,eps]) for versed cosine and covercos(x, [,eps]) for inverse versed cosine. diff --git a/LIBRARY b/LIBRARY index 71dd501..70b42ea 100644 --- a/LIBRARY +++ b/LIBRARY @@ -653,6 +653,13 @@ The 2nd argument to c_to_q() determines if the complex argument should be freed or not. Pass a false value as the 2nd arg if you wish to continue to use the COMPLEX value. +To convert a NUMBER into a COMPLEX value, use: + + COMPLEX *c; + NUMBER *q; + + c = q_to_c(q); + There are three predefined values for complex numbers. You should clink them when you want to use them. They are _czero_, _cone_, and _conei_. These have the values 0, 1, and i.