summaryrefslogtreecommitdiff
path: root/graphics/ploticus/patches/patch-ac
blob: 140352edc6999752914c0a002b022a0f2d05046e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$NetBSD: patch-ac,v 1.1 2001/07/08 08:09:40 rh Exp $

--- units.c.orig	Sun Jul  8 09:52:03 2001
+++ units.c
@@ -275,8 +275,14 @@
 else i = 1;
 
 if( unittyp[i] == LINEAR ) {
+	/* when generating incremental axes moving from negative to positive, for zero sprintf sometimes 
+	   gives -0.00 or very tiny values like -5.5579e-17.  The following is a workaround.. scg 7/5/01 */
+	if( f < 0.0000000000001 && f > -0.0000000000001 ) f = 0.0;
+
 	if( strlen( format ) < 1 ) sprintf( result, "%g", f );
 	else sprintf( result, format, f );
+
+
 	if( Bignumspacer ) rewritenums( result ); /* rewrite w/various spacing, decimal pt options*/
 	}