Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Function |checked_mul

std/ops/num::|checked_mul


Usage

|checked_mul<N>(a, b)

Generics

◻ N: CheckedMul

Parameters

↳ a: N
↳ b: N

Return

Option<N>


Multiply a and b, checking if overflow occurs

This function returns an option containing a × b, or none if result cause overflow in data type.