crates_practice 0.1.0

Mathematical calculations
Documentation

    //! # Basic Calculation Crate
    //! This crate consists of mathematical operations
    //! 

        ///ADDITION
        ///# EXAMPLES 
        /// 
        /// ```
        /// let (x,y) = (5,4);
        /// let ans = advance_rust::file3::add(x,y);
        /// assert_eq!(9,ans);
        /// ```
        ///  # Real life Example
        /// 
        /// 5 + 4 = 9
        /// 
        pub fn add(x: i32, y: i32) -> i32 {x + y}

        ///MULTIPLICATION
        ///# EXAMPLES 
        /// 
        /// ```
        /// let (x,y) = (6,4);
        /// let ans = advance_rust::file3::mul(x,y);
        /// assert_eq!(24,ans);
        /// ```
        ///  # Real life Example
        /// 
        /// 6 * 4 = 20  
        /// 
        pub fn mul(x: i32, y: i32) -> i32 {x * y}

        ///SUBTRACTION
        ///# EXAMPLES 
        /// 
        /// ```
        /// let (x,y) = (5,4);
        /// let ans = advance_rust::file3::sub(x,y);
        /// assert_eq!(1,ans);
        /// ```
        ///  # Real life Example
        /// 
        /// 5 - 4 = 1
        /// 
        pub fn sub(x: i32, y: i32) -> i32 {x - y}

        ///DIVISION
        ///# EXAMPLES 
        /// 
        /// ```
        /// let (x,y) = (20,4);
        /// let ans = advance_rust::file3::div(x,y);
        /// assert_eq!(5,ans);
        /// ```
        ///  # Real life Example
        /// 
        /// 20 / 4 = 5
        /// 
        pub fn div(x: i32, y: i32) -> i32 {x / y}

        ///REMAINDER
        ///# EXAMPLES 
        /// 
        /// ```
        /// let (x,y) = (10,3);
        /// let ans = advance_rust::file3::rem(x,y);
        /// assert_eq!(1,ans);
        /// ```
        ///  # Real life Example
        /// 
        /// 10 % 4 = 1 (remainder)
        /// 
        pub fn rem(x: i32, y: i32) -> i32 {x % y}