Re: GnomeCanvasLine



On Thu, May 04, 2000 at 01:34:18PM +0100, Gustavo Joćo Alves Marques Carneiro wrote:
>   Ok. I'm a bit convinced. But maybe one could use hypot where available,
> which is a function that calculates srqt(dx*dx + dy*dy) in a faster way. I
> think it's a GNU extension.

Since we've descended into total trivia here, I'll just point out that
(on my system, at least) hypot is (essentially) defined as

#define hypot(x,y) sqrt(x*x+y*y)

It is actually defined by inlining the appropriate code, not by just
standard macro expansion, but for all practical purposes the results
are the same.

One upon a time a separate, optimized, hypot() call might have made
sense, but not anymore.

If anything, hypot should use a different algorithm because computing
sqrt(x*x+y*y) can be numerically unstable --- but that is an entirely
different thread altogether. :-)

-JT

-- 
GNU/Linux: Free your mind and your OS will follow.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]