ok, got it. thanks
Rémi On Sat, Apr 5, 2014 at 9:34 PM, Huon Wilson <[email protected]> wrote: > Floating point numbers don't have a total ordering (all of these are > false: NaN < NaN, NaN == NaN, NaN > NaN). > > Use the floating-point specific method, `self.a.max(self.b)`. > > > Huon > > > On 05/04/14 19:30, Rémi Fontan wrote: > > Hi, > > when compiling following code with rust 0.10 I get following error: > > use std::cmp; > struct vec2d { a:f32, b:f32 } > impl vec2d { > pub fn max(&self) -> f32 { > cmp::max(self.a, self.b) > } > } > > test.rs:6:9: 6:17 error: failed to find an implementation of trait > std::cmp::TotalOrd for f32 > test.rs:6 cmp::max(self.a, self.b) > ^~~~~~~~ > make: *** [test-test] Error 101 > > > have I missed something? > > > cheers, > > Rémi > > -- > Rémi Fontan : [email protected] > mobile: +64 21 855 351 > 93 Otaki Street, Miramar 6022 > Wellington, New Zealand > > > _______________________________________________ > Rust-dev mailing > [email protected]https://mail.mozilla.org/listinfo/rust-dev > > > > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev > > -- Rémi Fontan : [email protected] mobile: +64 21 855 351 93 Otaki Street, Miramar 6022 Wellington, New Zealand
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
