From: Simon Marlow Date: Mon, 30 Jan 2006 11:53:01 +0000 (+0000) Subject: fix bug #664 in printSample() X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a0f8de19ed0c87abe16a7008a444f8563b351dd1;p=ghc-hetmet.git fix bug #664 in printSample() 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. --- diff --git a/ghc/rts/ProfHeap.c b/ghc/rts/ProfHeap.c index 8c088b7..c7ed1d0 100644 --- a/ghc/rts/ProfHeap.c +++ b/ghc/rts/ProfHeap.c @@ -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)); } /* --------------------------------------------------------------------------