www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/04/05:10:38

Date: Thu, 4 Mar 1999 12:07:27 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Martin Ambuhl <mambuhl AT earthlink DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: angle
In-Reply-To: <36DD84ED.FAF5CF82@earthlink.net>
Message-ID: <Pine.SUN.3.91.990304120705.1354K-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

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.)

- Raw text -


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