[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff-commit] groff ChangeLog src/preproc/pic/object.cpp
From: |
Werner LEMBERG |
Subject: |
[Groff-commit] groff ChangeLog src/preproc/pic/object.cpp |
Date: |
Tue, 01 Sep 2009 05:26:35 +0000 |
CVSROOT: /cvsroot/groff
Module name: groff
Changes by: Werner LEMBERG <wl> 09/09/01 05:26:33
Modified files:
. : ChangeLog
src/preproc/pic: object.cpp
Log message:
[pic] Fix a border case for arc computation.
* src/preproc/pic/object.cpp (object_spec::make_arc): It can happen
that test `radius < d' in the loop is satisfied, but the difference
in the two values is on the order of 1e-10. If `radius' is small,
doubling the value can lead to a fairly gross error.
The original code appears to have been intended to deal with the
situation when radius is orders of magnitude less than `d'. The
replacement code simply assigns `radius' the smallest value that
avoids problems with the floating point code further on in the
routine.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/ChangeLog?cvsroot=groff&r1=1.1208&r2=1.1209
http://cvs.savannah.gnu.org/viewcvs/groff/src/preproc/pic/object.cpp?cvsroot=groff&r1=1.11&r2=1.12
Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/ChangeLog,v
retrieving revision 1.1208
retrieving revision 1.1209
diff -u -b -r1.1208 -r1.1209
--- ChangeLog 14 Aug 2009 18:14:47 -0000 1.1208
+++ ChangeLog 1 Sep 2009 05:26:30 -0000 1.1209
@@ -1,3 +1,18 @@
+2009-09-01 Michael Cain <address@hidden>
+
+ [pic] Fix a border case for arc computation.
+
+ * src/preproc/pic/object.cpp (object_spec::make_arc): It can happen
+ that test `radius < d' in the loop is satisfied, but the difference
+ in the two values is on the order of 1e-10. If `radius' is small,
+ doubling the value can lead to a fairly gross error.
+
+ The original code appears to have been intended to deal with the
+ situation when radius is orders of magnitude less than `d'. The
+ replacement code simply assigns `radius' the smallest value that
+ avoids problems with the floating point code further on in the
+ routine.
+
2009-08-14 Roger Leigh <address@hidden>
* man/groff_char.man: Fix white heart and diamond unicode values.
Index: src/preproc/pic/object.cpp
===================================================================
RCS file: /cvsroot/groff/groff/src/preproc/pic/object.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- src/preproc/pic/object.cpp 5 Jan 2009 20:11:08 -0000 1.11
+++ src/preproc/pic/object.cpp 1 Sep 2009 05:26:32 -0000 1.12
@@ -1830,8 +1830,8 @@
if (radius <= 0)
radius = .25;
// make the radius big enough
- while (radius < d)
- radius *= 2.0;
+ if (radius < d)
+ radius = d;
double alpha = acos(d/radius);
double theta = atan2(h.y, h.x);
if (cw)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Groff-commit] groff ChangeLog src/preproc/pic/object.cpp,
Werner LEMBERG <=