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 checkedNeg

std/ops/num::checkedNeg


Generics

◻ N: CheckedNeg

Inputs

⇥ value: Stream<N>

Outputs

↦ neg: Stream<Option<N>>


Give negation of streamed values, checking if overflow occurs.

This treatment outputs an option containing -value, or none if result cause overflow in data type.