Treatment checkedAdd
std/ops/num::checkedAdd
Generics
◻ N:
CheckedAdd
Inputs
⇥ a:
Stream<N>
⇥ b:
Stream<N>
Outputs
↦ sum:
Stream<Option<N>>
Add values from two streams, checking if overflow occurs.
Values passed through a
& b
are added and send in sum
.
This treatment outputs an option containing a + b
, or none if result cause overflow in data type.