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

Treatment checkedMul

std/ops/num::checkedMul


Generics

◻ N: CheckedMul

Inputs

⇥ a: Stream<N>
⇥ b: Stream<N>

Outputs

↦ prod: Stream<Option<N>>


Multiply values from two streams, checking if overflow occurs.

Values passed through a & b are multiplied and send in prod. This treatment outputs an option containing a × b, or none if result cause overflow in data type.