Commit b87aeb11 authored by Christoph Häfner's avatar Christoph Häfner

Add composite-number

parent 235bb6b3
fn opposite(number: i32) -> i32 {
-number
}
fn opposite(number: i32) -> i32 {
(-1) * number
}
#[test]
fn returns_expected() {
assert_eq!(opposite(1), -1);
assert_eq!(opposite(-1), 1);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment