#include <vtkInformation.h>
#include <vtkInformationVector.h>
-#define USE_SPRINTF 1
+// Algorithm to cut values (see CutValue())
+// Use sprintf function
+#define USE_SPRINTF
+// Use new algorithm (works only when USE_SPRINTF is disabled)
+#define USE_NEW_ALGORITHM
//----------------------------------------------------------------------------
vtkStandardNewMacro(VISU_Extractor);
{
vtkFloatingPointType v = theValue;
-#ifdef USE_SPRINTF
+#if defined(USE_SPRINTF)
char aFormat[16];
sprintf(aFormat, "%%.%dg", theDecimals);
char aStr [256];
sprintf(aStr, aFormat, theValue);
v = atof(aStr);
-#else
-
-#ifndef USE_OLD_ALGORITHM
+#elif defined(USE_NEW_ALGORITHM)
//
// VSR 19/10/2009: new algorithm does not use long long type
//
aDegree = pow(10, aDegree);
v = ((vtkFloatingPointType)((long long)(v * aDegree))) / aDegree;
//printf("$$$ 2 v = %.20g , aDegree = %lld \n", v, (long long)aDegree);
-#endif
-
#endif
return v;