div

Git Source

Divides two SD49x28 numbers, returning a new SD49x28 number.

*This is an extension of {Common.mulDiv} for signed numbers, which works by computing the signs and the absolute values separately. Notes:

  • Refer to the notes in {Common.mulDiv}.
  • The result is rounded toward zero. Requirements:
  • Refer to the requirements in {Common.mulDiv}.
  • None of the inputs can be MIN_SD49x28.
  • The denominator must not be zero.
  • The result must fit in SD49x28.*
function div(SD49x28 x, SD49x28 y) pure returns (SD49x28 result);

Parameters

NameTypeDescription
xSD49x28The numerator as an SD49x28 number.
ySD49x28The denominator as an SD49x28 number.