fix bug #664 in printSample()
authorSimon Marlow <simonmar@microsoft.com>
Mon, 30 Jan 2006 11:53:01 +0000 (11:53 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Mon, 30 Jan 2006 11:53:01 +0000 (11:53 +0000)
printSample() was attempting to round the fractional part of the time,
but not propagated to the non-fractional part.  It's probably better not
to attempt to round the time at all.

ghc/rts/ProfHeap.c

index 8c088b7..c7ed1d0 100644 (file)
@@ -389,7 +389,7 @@ printSample(rtsBool beginSample, StgDouble sampleValue)
     fractionalPart = modf(sampleValue, &integralPart);
     fprintf(hp_file, "%s %d.%02d\n",
             (beginSample ? "BEGIN_SAMPLE" : "END_SAMPLE"),
-            (int)integralPart, (int)(fractionalPart * 100 + 0.5));
+            (int)integralPart, (int)(fractionalPart * 100));
 }
 
 /* --------------------------------------------------------------------------