Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit 39996e2

Browse files
authored
simplify calculating percentages fixing #1194 (#1236)
1 parent 96a60e2 commit 39996e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

haddock-api/src/Haddock/Interface.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ processModule verbosity modsum flags modMap instIfaceMap = do
182182
liftIO $ mapM_ putStrLn (nub msgs)
183183
dflags <- getDynFlags
184184
let (haddockable, haddocked) = ifaceHaddockCoverage interface
185-
percentage = floor (fromIntegral haddocked * 100 / fromIntegral haddockable :: Double) :: Int
185+
percentage = div (haddocked * 100) haddockable
186186
modString = moduleString (ifaceMod interface)
187187
coverageMsg = printf " %3d%% (%3d /%3d) in '%s'" percentage haddocked haddockable modString
188188
header = case ifaceDoc interface of

0 commit comments

Comments
 (0)