delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/05/02:42:29

Newsgroups: comp.os.msdos.djgpp
From: Peter Berdeklis <peter AT atmosp DOT physics DOT utoronto DOT ca>
Subject: Re: complex in c (!c++)
Message-ID: <Pine.SGI.3.91.970304151056.19595A-100000@chinook.physics.utoronto.ca>
Nntp-Posting-Host: chinook.physics.utoronto.ca
Sender: news AT info DOT physics DOT utoronto DOT ca (System Administrator)
Mime-Version: 1.0
Organization: University of Toronto - Dept. of Physics
In-Reply-To: <Pine.SUN.3.91.970302132947.6609R-100000@is>
Date: Tue, 4 Mar 1997 20:24:46 GMT
References: <Pine DOT SUN DOT 3 DOT 91 DOT 970302132947 DOT 6609R-100000 AT is>
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019