Function |checked_neg

std/ops/num::|checked_neg


Usage

|checked_neg<N>(val)

Generics

◻ N: CheckedNeg

Parameters

↳ val: N

Return

Option<N>


Return negation of given value, checking if overflow occurs

This function returns an option containing -val, or none if result cause overflow in data type.