is_one

Function is_one 

Source
pub fn is_one(expr: &Expression) -> bool
Expand description

Check if expression is the constant 1

§Arguments

  • expr - The expression to check

§Examples

use mathhook_core::calculus::integrals::risch::helpers::is_one;
use mathhook_core::Expression;

let one = Expression::integer(1);
assert!(is_one(&one));

let two = Expression::integer(2);
assert!(!is_one(&two));