//rounds to zero if x*y < WAD / 2
function wmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), WAD / 2) / WAD;
}
//rounds to zero if x*y < WAD / 2
function rmul(uint x, uint y) internal pure returns (uint z) {
z = add(mul(x, y), RAY / 2) / RAY;
}
I think it'll add artifact small number ex. 2WAD x 1WAD = 2WAD + 0.5 Is it for safety reasons?
and what is
//rounds to zero if x*y < WAD / 2
I can’t figure it out.
rounds to zero if x*y < WAD / 2. – goodvibration Nov 28 '20 at 09:04RAYinstead ofWAD. – goodvibration Nov 28 '20 at 09:05