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 checkedSub

std/ops/num::checkedSub


Generics

◻ N: CheckedSub

Inputs

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

Outputs

↦ diff: Stream<Option<N>>


Substract values from two streams, checking if overflow occurs.

Values passed through b are substracted to a and send in diff. This treatment outputs an option containing a - b, or none if result cause overflow in data type.