maths_function 0.1.4

Some maths fuctions
Documentation
// 加法函数
pub fn add(a: i32, b: i32) -> i32 {
    a + b
}
//减法函数
pub fn subtract(a: i32, b: i32) -> i32 {
    a - b
}
// 乘法函数
pub fn multiply(a: i32, b: i32) -> i32 {
    a * b
}
// 除法函数
pub fn divide(a: i32, b: i32) -> Result<i32, &'static str> {
    if b == 0 {
        Err("Cannot divide by zero")
     } else {
        Ok(a / b)
    }
}
//平方函数
pub fn square(x: f64) -> f64 {
    x * x
}
//立方函数
pub fn cube(x: f64) ->f64{
    x*x*x
}
//计算两点距离多少像素(px)
pub fn distance(a_x: i32, a_y: i32, b_x: i32, b_y: i32) -> f32 {
    let delta_x = (a_x - b_x) as f32;
    let delta_y = (a_y - b_y) as f32;

    let distance = (delta_x.powf(2.0) + delta_y.powf(2.0)).sqrt();
    distance
}