Newsgroups: comp.os.msdos.djgpp From: Peter Berdeklis Subject: Re: complex in c (!c++) Message-ID: Nntp-Posting-Host: chinook.physics.utoronto.ca Sender: news AT info DOT physics DOT utoronto DOT ca (System Administrator) Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Organization: University of Toronto - Dept. of Physics In-Reply-To: Date: Tue, 4 Mar 1997 20:24:46 GMT References: Lines: 24 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Sun, 2 Mar 1997, Eli Zaretskii wrote: > On Sat, 1 Mar 1997, Gurunandan R. Bhat wrote: > > gives a wrong zz. i would be grateful if users of __complex__ in c could > > share their experience on this. would it correct to conclude that while > > simple algebraic manipulations are implemented, math functions are not? > > I think the problem is that the library doesn't support complex data type. > The algebraic operations are implemented by calling functions from > libgcc.a, therefore they work. You will have to explicitly write the > complex math functions in terms of the real and imaginary parts, to get > full support for complex computations. I missed the original article so I don't know exactly which functions Gurunandan is asking about. However, the class complex is part of the C++ Draft Standard and it includes templated complex math functions like pow, log, sqrt, and the trig and hyperbolic trig functions. These are implemented in gcc 2.7.2. If they give the wrong answer then there is a bug, but since all the functions are templates the bug should be easy to trace and correct since all the code is in a header file. --------------- Peter Berdeklis Dept. of Physics, Univ. of Toronto