Skip to main content

new_crate_rust/
lib.rs

1///compute the cube of a number
2/// 
3/// #Example
4/// ```
5/// let n=5;
6/// let answer=new_crate_rust::cube(n);
7/// assert_eq!((125),answer);
8/// ```
9/// #limitations
10///
11///#some other section 
12///
13pub fn cube(num:i32)->i32{
14    num*num*num
15}
16///compute the square of a number
17/// 
18/// #Example
19/// ```
20/// let n=5;
21/// let answer=new_crate_rust::square(n);
22/// assert_eq!((25),answer);
23/// ```
24/// #limitations
25///
26///#some other section 
27///
28pub fn square(num:i32)->i32{
29    num*num
30}