Skip to main content

checked_add

Function checked_add 

Source
pub fn checked_add(lhs: Expression, rhs: Expression) -> Expression
Expand description

Create a new Binary using the Add operator.

ยงExample usage

let xs = buffer![1, 2, 3].into_array();
let result = xs.apply(&checked_add(root(), lit(5))).unwrap();

let mut ctx = array_session().create_execution_ctx();
let result = result.execute::<PrimitiveArray>(&mut ctx).unwrap();
assert_eq!(result.as_slice::<i32>(), [6, 7, 8]);