src/ringFinder.cc

changeset 868
6e03c68c81ba
parent 861
83426c5fa732
child 927
409b82a4765e
--- a/src/ringFinder.cc	Sun Aug 31 03:10:51 2014 +0300
+++ b/src/ringFinder.cc	Sun Aug 31 14:38:53 2014 +0300
@@ -135,11 +135,18 @@
 		double r0f = r0 / scale;
 		double r1f = r1 / scale;
 
-		if (qFuzzyCompare (floor (r0f), r0f) and qFuzzyCompare (floor (r1f), r1f))
+		if (IsIntegral (r0f) and IsIntegral (r1f))
 		{
 			r0 = r0f;
 			r1 = r1f;
 		}
+		// If the numbers are both at most one-decimal fractions, we can use a scale of 10
+		elif (IsIntegral (r0 * 10) and IsIntegral (r1 * 10))
+		{
+			scale = 0.1;
+			r0 *= 10;
+			r1 *= 10;
+		}
 	}
 	else
 	{

mercurial