on master help sign in
Cast to widest fixed integer to avoid truncation trouble
commit663a117ac8f55870be5162be6f41f7b5ebd9b15a authorBryan O'Sullivan <bos@serpentine.com> dateTue 19 Mar 2013, 09:57 (14 years ago) parentf6f6d5c
1 file changed+1−1
Data/Text/Lazy/Builder/Int.hs+1−1
Data/Text/Lazy/Builder/Int.hs+1−1
@@ -119,7 +119,7 @@ i2w v = zero + fromIntegral v
119119
120120countDigits :: (Integral a) => a -> Int
121121{-# INLINE countDigits #-}
122−countDigits = go 1
122+countDigits v0 = go 1 (fromIntegral v0 :: Word64)
123123 where go !k v
124124 | v < 10 = k
125125 | v < 100 = k + 1