[vox-tech] C99 - Initializing complex

Peter Jay Salzman p at dirac.org
Mon Sep 6 15:12:47 PDT 2004


Must both parts of a complex variable be initialized:

   long double complex z = 0.0L + 0.0L*I;           (i)

or does only one part need to be initialized?

   long double complex z = 0.0L;                    (ii)

A test program shows that (ii) "works", but I couldn't find an authoritative
answer in the C99 standard.  Although I have no intention of using anything
but Linux, I still don't want to rely on GNU extensions (as much as
possible).


BTW, my copy of the C99 standard is from August 3, 1998 and appears to be a
"pre-release".  I'm a little surprised that a Google search for "C99
standard" just doesn't give a copy of the standard the way a Google search
for "US Constitution" yields the Constitution.  Where is the official copy of
this standard?

Thx,
Pete

-- 
Make everything as simple as possible, but no simpler. -- Albert Einstein
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D


More information about the vox-tech mailing list