[Rivet-svn] r2716 - trunk/include/LWH

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Oct 14 18:49:46 BST 2010


Author: lonnblad
Date: Thu Oct 14 18:49:45 2010
New Revision: 2716

Log:
_neq didn't really work for negative arguments.

Modified:
   trunk/include/LWH/HistogramFactory.h

Modified: trunk/include/LWH/HistogramFactory.h
==============================================================================
--- trunk/include/LWH/HistogramFactory.h	Thu Oct 14 16:48:41 2010	(r2715)
+++ trunk/include/LWH/HistogramFactory.h	Thu Oct 14 18:49:45 2010	(r2716)
@@ -781,8 +781,8 @@
 
 
   inline bool _neq(double a, double b, double eps = 1e-5) const {
-    if (a == 0 && b == 0) return false;
-    if (fabs(a-b) < eps*(a+b)) return false;
+    if ( a == 0 && b == 0 ) return false;
+    if ( fabs(a - b) < eps*(fabs(a) + fabs(b)) ) return false;
     return true;
   }
 


More information about the Rivet-svn mailing list