Created
October 30, 2017 21:53
-
-
Save PJK/dd31472b87c470c8cffcf5640b5c934e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn sgn(x: i32) -> i32 { | |
match x { | |
y if y < 0 => -1, | |
y if y == 0 => 0, | |
y if y > 0 => 1, | |
} | |
} | |
fn main() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment