mirror of
https://github.com/kmc7468/cs220.git
synced 2026-11-04 00:00:33 +09:00
Assignment 1 Done
This commit is contained in:
1 parent
8bfbd8f90e
commit
456fabc992
1 file changed
+2
-2
@@ -8,10 +8,10 @@
|
|||||||
|
|
||||||
/// Adds two unsigned words. If overflow happens, just wrap around.
|
/// Adds two unsigned words. If overflow happens, just wrap around.
|
||||||
pub fn add(lhs: usize, rhs: usize) -> usize {
|
pub fn add(lhs: usize, rhs: usize) -> usize {
|
||||||
todo!()
|
lhs.wrapping_add(rhs)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Subtracts two unsigned words. If overflow happens, just wrap around.
|
/// Subtracts two unsigned words. If overflow happens, just wrap around.
|
||||||
pub fn sub(lhs: usize, rhs: usize) -> usize {
|
pub fn sub(lhs: usize, rhs: usize) -> usize {
|
||||||
todo!()
|
lhs.wrapping_sub(rhs)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user