Skip to content

Commit

Permalink
move to ceiling
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoeldner committed Oct 15, 2024
1 parent 62e5e15 commit 11fa505
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pact/Pact/Core/IR/Eval/CEK/CoreBuiltin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ rawPow info b cont handler _env = \case
decPow base pow = do
when (base == 0 && pow < 0) $
throwExecutionError info (FloatingPointError "zero to a negative power is undefined")
let integralPart = floor pow
chargeGasArgs info $ GIntegerOpCost PrimOpPow (floor base) integralPart
let integralPart = ceiling pow
chargeGasArgs info $ GIntegerOpCost PrimOpPow (ceiling base) integralPart
result <- guardNanOrInf info $ MPFR.mpfr_pow base pow
returnCEKValue cont handler (VLiteral (LDecimal result))

Expand Down
4 changes: 2 additions & 2 deletions pact/Pact/Core/IR/Eval/Direct/CoreBuiltin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ rawPow info b _env = \case
decPow base pow = do
when (base == 0 && pow < 0) $
throwExecutionError info (FloatingPointError "zero to a negative power is undefined")
let integralPart = floor pow
chargeGasArgs info $ GIntegerOpCost PrimOpPow (floor base) integralPart
let integralPart = ceiling pow
chargeGasArgs info $ GIntegerOpCost PrimOpPow (ceiling base) integralPart
result <- guardNanOrInf info $ MPFR.mpfr_pow base pow
return (VLiteral (LDecimal (result)))

Expand Down

0 comments on commit 11fa505

Please sign in to comment.