Fix a horribly shameful bug computing a modulo on floats

This commit is contained in:
Tissevert 2019-04-14 19:49:19 +02:00
parent 2d9cfd818d
commit e1f338f1f1
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ scheduleByMedicine pharmacy day medicineName stockLeft rate =
where
(Medicine {minStock, content}) = pharmacy ! medicineName
truncateF = fromInteger . truncate
leftInBox = content - (truncateF (content / stockLeft) * stockLeft)
leftInBox = stockLeft - (truncateF (stockLeft / content) * content)
typeAndAmount :: Float -> Float -> Float -> (ScheduleType, Float)
typeAndAmount stockLeft minStock leftInBox =