coerce

Coerce a decimal value into this type: rescale it to scale with rounding, then apply overflow if the result falls outside min..max.

Overflow.TRUNCATE_HIGH keeps as many low-order digits as the wider of min and max has, keeping the sign.

Overflow.WRAP wraps modulo the size of the range, so -128..127 at scale 0 behaves like a signed byte.

Throws

if rounding is prohibited and the value is inexact, if overflow is Overflow.ERROR and the value is out of range, or if truncation still leaves it out of range