Skip to content

Instantly share code, notes, and snippets.

@brendanzab
Created October 28, 2012 06:29
Show Gist options
  • Select an option

  • Save brendanzab/3967876 to your computer and use it in GitHub Desktop.

Select an option

Save brendanzab/3967876 to your computer and use it in GitHub Desktop.
abs
pure fn abs<T:Copy Num Ord>(x: &T) -> T {
if x >= from_int(0) { *x } else {-x }
}
./src/math.rs:23:12: 23:20 error: failed to find an implementation of trait @core::num::Num for <V13>
./src/math.rs:23 if x >= from_int(0) { *x } else {-x }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment