Skip to content

Commit 68cff90

Browse files
authored
Merge pull request #315 from onflow/bastian/improve-round-up
Improve FlowALPMath.roundUp
2 parents 2ff705f + b35b48f commit 68cff90

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

cadence/lib/FlowALPMath.cdc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ access(all) contract FlowALPMath {
8383
}
8484

8585
access(self) view fun roundUp(_ base: UFix64): UFix64 {
86-
let increment: UFix64 = 0.00000001
87-
return base >= UFix64.max - increment ? UFix64.max : base + increment
86+
return base.saturatingAdd(0.00000001)
8887
}
8988

9089
access(self) view fun roundHalfToEven(_ base: UFix64, _ remainder: UFix128): UFix64 {

0 commit comments

Comments
 (0)