Function safeSubtract

  • Safe subtracts two uints and returns an error if the result is invalid.

    Underflows when result is less than 0.

    Type Parameters

    Parameters

    • left: T
    • right: T
    • allowNegative: boolean = false

    Returns T