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 saturatingMul

std/ops/num::saturatingMul


Generics

◻ N: SaturatingMul

Inputs

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

Outputs

↦ prod: Stream<N>


Multiply values from two streams, saturating to bounds.

Values passed through a & b are multiplied and send in prod. This treatment is infaillible and saturate to the closest bound, minimal or maximal, if a × b is out of bounds for the data type.