www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/04/07:46:16

From: Martin Ambuhl <mambuhl AT earthlink DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: angle
Date: Thu, 04 Mar 1999 06:54:26 -0500
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990304120705 DOT 1354K-100000 AT is>
X-Posted-Path-Was: not-for-mail
X-Accept-Language: en
X-ELN-Date: 4 Mar 1999 11:54:09 GMT
X-ELN-Insert-Date: Thu Mar 4 03:55:06 1999
Organization: Nocturnal Aviation
Lines: 24
Mime-Version: 1.0
NNTP-Posting-Host: 1cust151.tnt12.nyc3.da.uu.net
Message-ID: <36DE7472.D4C12F22@earthlink.net>
X-Mailer: Mozilla 4.5 [en] (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> 
> On Wed, 3 Mar 1999, Martin Ambuhl wrote:
> 
> > polar to_polar(vector v)
> > {
> >     polar p;
> >     p.r = sqrt(sqr(v.x) + sqr(v.y));
> 
> It's much better to use library function `hypot' to do this.  (Hint:
> try the above with v.x = v.y = 1.e160 or v.x = v.y = 1.e-160.)

But you we note that nothing in my post was non-standard C, while
hypot() is.  This is not the only improvement available if the
non-standard functions in djgpp's libm.a are used, btw.  Also note that
my post was an answer to a beginner's math question.

Also, note that the representation of the plane as
__complex__ double 
would have been cleaner, but even 'more' non-standard C.

-- 
Martin Ambuhl (mambuhl AT earthlink DOT net)
Note: mambuhl AT tiac DOT net will soon be inactive

- Raw text -


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