C
Carl-Olof Almbladh
Dear all,
In C99, complex is now built in, and the C library
contains functions for complex exp, etc. It is not
so easy to find info about the syntax if one
is not willing to buy the ISO/ANSI standard document,
despite the fact that implementations are already available
Also, because it is built in, one cannot figure out
the syntax from the header files.
I have a few questions
a) How do I initialize a say double complex from
a pair of doubles, or, more generally, how
do I convert a pair of doubles to a double complex.
Of course one could do
z = x + I*y
where hopefully the complex multiply and add
can be optimized away, but there must be better
ways.
b) Primitives for say complex conjugates.
If someone can point to open sources of information
I would be grateful.
Carl-Olof Almbladh
In C99, complex is now built in, and the C library
contains functions for complex exp, etc. It is not
so easy to find info about the syntax if one
is not willing to buy the ISO/ANSI standard document,
despite the fact that implementations are already available
Also, because it is built in, one cannot figure out
the syntax from the header files.
I have a few questions
a) How do I initialize a say double complex from
a pair of doubles, or, more generally, how
do I convert a pair of doubles to a double complex.
Of course one could do
z = x + I*y
where hopefully the complex multiply and add
can be optimized away, but there must be better
ways.
b) Primitives for say complex conjugates.
If someone can point to open sources of information
I would be grateful.
Carl-Olof Almbladh