X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=includes%2Fcomplex.h;h=6e7ac5ed5ec7867db01f6d156a5a9a52b7e3250b;hb=70f1c6f7c9d515ef426da68973511f46de57005a;hp=59cb5b2c45facaefb2be191f02523365b48af6e0;hpb=ad2651a3d8a2e2ae70a5ad882518ef346ab1bc7b;p=pdclib diff --git a/includes/complex.h b/includes/complex.h index 59cb5b2..6e7ac5e 100644 --- a/includes/complex.h +++ b/includes/complex.h @@ -4,13 +4,14 @@ // 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 #define __COMPLEX_H __COMPLEX_H +#include "personality.h" + // ---------------------------------------------------------------------------- // DEFINES @@ -18,11 +19,14 @@ #define complex _Complex #endif -#define _Complex_I (float _Complex){0, 1} -#define imaginary _Imaginary // optional +#define _Complex_I ( const float _Complex ) { 0, 1 } + +#ifdef __PERSONALITY_SUPPORTS_IMAGINARY +#define imaginary _Imaginary +#endif // __PERSONALITY_SUPPORTS_IMAGINARY #ifdef imaginary -#define _Imaginary_I ((float _Imaginary)1) +#define _Imaginary_I ( ( const float _Imaginary ) 1 ) #endif #ifdef imaginary