ranged_int/utils

Types

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

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

Constructors

  • WouldOverflow(BigInt)

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

  • WouldUnderflow(BigInt)

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

Functions

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

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

Search Document