Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

wad_ray_math

Provides functions to perform calculations with Wad and Ray units @dev Provides mul and div function for wads (decimal numbers with 18 digits of precision) and rays (decimal numbers with 27 digits of precision) Operations are rounded. If a value is >=.5, will be rounded up, otherwise rounded down. https://github.com/aave/aave-v3-core/blob/master/contracts/protocol/libraries/math/WadRayMath.sol

Fully qualified path: alexandria_math::wad_ray_math

Free functions

wadReturn the wad value…
rayReturn the ray value…
half_wadReturn the half wad value…
half_rayReturn the half ray value…
wad_mulMultiplies two wad, rounding half up to the nearest wad…
wad_divDivides two wad, rounding half up to the nearest wad…
ray_mulMultiplies two ray, rounding half up to the nearest ray…
ray_divDivides two ray, rounding half up to the nearest ray…
ray_to_wadCasts ray down to wad…
wad_to_rayConverts wad up to ray…