simple_math_utils 0.1.0

A simple Rust crate for basic math functions
Documentation
/// Returns the square of a number.
pub fn square(num: i32) -> i32 {
    num * num
}

/// Returns the cube of a number.
pub fn cube(num: i32) -> i32 {
    num * num * num
}

/// Checks if a number is even.
pub fn is_even(num: i32) -> bool {
    num % 2 == 0
}
#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_square() {
        assert_eq!(square(4), 16);
    }

    #[test]
    fn test_cube() {
        assert_eq!(cube(3), 27);
    }

    #[test]
    fn test_is_even() {
        assert!(is_even(2));
        assert!(!is_even(3));
    }
}