Fix a horribly shameful bug computing a modulo on floats
This commit is contained in:
parent
2d9cfd818d
commit
e1f338f1f1
1 changed files with 1 additions and 1 deletions
|
@ -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 =
|
||||
|
|
Loading…
Reference in a new issue