Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fabien's work on surf
[simgrid.git] / src / include / surf / maxmin.h
index 7f58d7c..cf32554 100644 (file)
@@ -9,8 +9,10 @@
 
 #include "portable.h"
 #include "xbt/misc.h"
+#include "xbt/asserts.h"
 #include "surf/datatypes.h"
 #include <math.h>
+//#include <float.h>
 
 
 /** @addtogroup SURF_lmm 
 
 extern double sg_maxmin_precision;
 extern double sg_surf_precision;
-
 static XBT_INLINE void double_update(double *variable, double value, double precision)
 {
+  //printf("Updating %g -= %g +- %g\n",*variable,value,precision);
+  //xbt_assert(value==0  || value>precision);
+  //Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding  may happen, and the precision mechanism is not active... 
+  //xbt_assert(*variable< (2<<DBL_MANT_DIG)*precision && FLT_RADIX==2);
   *variable -= value;
   if (*variable < precision)
     *variable = 0.0;