X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=includes%2Fcomplex.h;h=d4cc9ea990bd7ba5b34a23ddda34db0c06f1fc98;hp=59cb5b2c45facaefb2be191f02523365b48af6e0;hb=ac3f809c3c10347c110fac3db93af0954eda98bb;hpb=8b8277d2940a8745f85d86a9af3ad6970b5fa52c diff --git a/includes/complex.h b/includes/complex.h index 59cb5b2..d4cc9ea 100644 --- a/includes/complex.h +++ b/includes/complex.h @@ -4,8 +4,7 @@ // Public Domain C Library - http://pdclib.sourceforge.net // This code is Public Domain. Use, modify, and redistribute at will. // ---------------------------------------------------------------------------- -// Provides the types float _Complex, double _Complex and long double _Complex -// plus math functions on those types. +// Complex arithmetic // ---------------------------------------------------------------------------- #ifndef __COMPLEX_H @@ -18,11 +17,13 @@ #define complex _Complex #endif -#define _Complex_I (float _Complex){0, 1} -#define imaginary _Imaginary // optional +#define _Complex_I ( const float _Complex ) { 0, 1 } + +// TODO: imaginary is only defined if implementation supports _Imaginary. +#define imaginary _Imaginary #ifdef imaginary -#define _Imaginary_I ((float _Imaginary)1) +#define _Imaginary_I ( ( const float _Imaginary ) 1 ) #endif #ifdef imaginary