bug-groff
[Top][All Lists]
Advanced

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

Re: groff on Interix problem, rehashed


From: Todd Vierling
Subject: Re: groff on Interix problem, rehashed
Date: Sun, 13 Mar 2005 19:10:49 -0500 (EST)

On Sun, 13 Mar 2005, Todd Vierling wrote:

> \h'NaNi'\v'NaNi'\D'lNaNi NaNi'

This appears to be an odd problem with hypot(const position &) -- it's
returning NaN for a case where "dist" is x=0,y=0.

I'm going to work around it in my build by adding an isnan() check that ends
up returning 0.0 instead, but this will need some more investigation
nonetheless to see why it's doing that (perhaps round-off error is making
the args "not quite zero").

Sorry for the vague first post.  The diff which fixed me (against 1.19.1)
follows, but it's likely an egregious hack and probably should be wrapped in
"#ifdef __INTERIX".

--- src/preproc/pic/object.cpp.orig     Wed Apr  7 11:27:56 2004
+++ src/preproc/pic/object.cpp
@@ -202,7 +202,13 @@ double operator*(const position &a, cons

 double hypot(const position &a)
 {
-  return hypot(a.x, a.y);
+  double result = hypot(a.x, a.y);
+
+  /* prevents an endless loop that pops up particularly on Interix */
+  if (isnan(result) && !isnan(a.x) && !isnan(a.y))
+    return 0.0;
+
+  return result;
 }

 struct arrow_head_type {

-- 
-- Todd Vierling <address@hidden> <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]