This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fwd: complex number


On Wed, Apr 1, 2009 at 1:30 PM, Corinna Vinschen wrote:
>
> > > That's the result of the newlib function which is defined
> > > as
> > >
> > > Â double
> > > Â cabs(z)
> > > Â struct complex z;
> > > Â {
> > > Â Â return hypot(z.x, z.y);
> > > Â }
> > >

That's from the newlib source code, I assume? While the function
cabs() exists inside newlib, and is declared as an extern in math.h,
it's not documented, nor is there a prototype for it or a declaration
of "struct complex" that I can find anywhere in the installed headers
(just the "complex" typedef in the gcc headers, whose structure
doesn't match the above). l Yet somehow the compiler is doing some
sort of typechecking anyway and rejecting everything I try to pass as
a parameter, so I can't validate the return value of cabs.

Did you determine that the C++ std::complex::abs() method winds up
calling cabs() eventually, or was that a guess? It's strange, because
calling hypot(a, b) directly yields the correct result.

--
Mark J. Reed <markjreed@gmail.com>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]