ranged_int/utils

Types

An overflow would have occurred, i.e. the result did not fit the allowed range.

pub type Overflow {
  WouldOverflow(bigi.BigInt)
  WouldUnderflow(bigi.BigInt)
}

Constructors

  • WouldOverflow(bigi.BigInt)

    The result was this much higher than the maximum allowed value.

  • WouldUnderflow(bigi.BigInt)

    The result was this much lower than the minimum allowed value.

Values

pub fn overflow(
  overflow: Overflow,
  min min: bigi.BigInt,
  max max: bigi.BigInt,
) -> bigi.BigInt

Calculate the overflowed value given an overflow result and the limits.

Search Document