prateek_pub_1/
lib.rs

1//! # Basic Math Crate
2//! This is a collection of some generally used math functions
3
4/// Computes square of the given number
5///
6/// # Examples
7///
8/// ```
9/// let n=5;
10/// let answer=prateek_pub_1::square(n);
11/// assert_eq!(25,answer);
12/// ```
13///
14/// # limitations
15///
16/// # Some other section
17
18pub fn square(num: i32) -> i32 {
19    num * num
20}
21
22
23/// Computes cube of the given number
24///
25/// # Examples
26///
27/// ```
28/// let n=5;
29/// let answer=prateek_pub_1::cube(n);
30/// assert_eq!(125,answer);
31/// ```
32///
33/// # limitations
34///
35/// # Some other section
36
37pub fn cube(num: i32) -> i32 {
38    num * num * num
39}