public static UFix8 CheckedAdd(UFix8 left, UFix8 right) { UFix16 value; try { value = UFix16.CheckedAdd(left, right); } catch (OverflowException) { throw new OverflowException(); } if ((float)value < MinValue || (float)value > MaxValue) { throw new OverflowException(); } return((UFix8)value); }
public void CheckedAddTest([RandAddOver] double left, [RandAddOver] double right) => Assert.That(() => UFix16.CheckedAdd((UFix16)left, (UFix16)right), ((Fix(left) + Fix(right)) is <= UFix16Max and >= UFix16Min)