use std::any::Any;
pub fn is_equal<A: Any + PartialEq<B>, B: Any>(num: &A, num2: &B) {
if num != num2 {
panic!("r-unit catched: Parameter 1 is not equal to parameter 2")
}
}
pub fn is_not_equal<A: Any + PartialEq<B>, B: Any>(num: &A, num2: &B) {
if num == num2 {
panic!("r-unit catched: Parameter 1 is equal to parameter 2")
}
}
pub fn is_less_than(num: &i32, num2: &i32) {
if *num >= *num2 {
panic!("r-unit catched: Parameter 1: {} is greater than parameter 2: {}", *num, *num2)
}
}
pub fn is_greater_than(num: &i32, num2: &i32) {
if *num <= *num2 {
panic!("r-unit catched: Parameter 1: {} is less than parameter 2: {}", *num, *num2)
}
}
pub fn is_negative(num: &i32) {
if *num > 0 {
panic!("r-unit catched: Parameter 1: {} is not negative", *num)
}
}
pub fn is_odd(num: &i32) {
if num % 2 == 0 {
panic!("r-unit catched: Parameter 1: {} is not odd", num)
}
}
pub fn is_even(num: &i32) {
if num % 2 == 1 {
panic!("r-unit catched: Parameter 1: {} is not even", num)
}
}
pub fn can_divide(divided: &i32, diviser: i32) -> bool {
if diviser == 0 {
return false;
}
divided % diviser == 0
}