Skip to content

Instantly share code, notes, and snippets.

@PaulRBerg
Created November 29, 2022 16:47
Show Gist options
  • Save PaulRBerg/d46ea46161c12e9803d0e74ed0c4d97b to your computer and use it in GitHub Desktop.
Save PaulRBerg/d46ea46161c12e9803d0e74ed0c4d97b to your computer and use it in GitHub Desktop.
All math functions in SD59x18 (v3.0.0)
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.13;
import "@prb/math/SD59x18.sol";
function allMathFunctions(SD59x18 x, SD59x18 y) pure {
abs(x);
avg(x, y);
ceil(x);
div(x, y);
exp(x);
exp2(x);
floor(x);
frac(x);
gm(x, y);
inv(x);
ln(x);
log10(x);
log2(x);
mul(x, y);
pow(x, y);
powu(x, 2);
sqrt(x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment