diff options
| author | bors <bors@rust-lang.org> | 2013-05-06 09:12:37 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-06 09:12:37 -0700 |
| commit | b6dea9d41df25f1c6a6a0444395a9b29c8081cbe (patch) | |
| tree | 885dcc297588b43cf7a3fb910274228a58ecde58 /src/rt/rust_kernel.cpp | |
| parent | 6e6a4be19d8e6a2cedc66be6cc602db8a1e71acd (diff) | |
| parent | 0e2242f6d62d6d49bf8a2d1860a41273c1fdfa0d (diff) | |
| download | rust-b6dea9d41df25f1c6a6a0444395a9b29c8081cbe.tar.gz rust-b6dea9d41df25f1c6a6a0444395a9b29c8081cbe.zip | |
auto merge of #6263 : bjz/rust/approx-eq, r=erickt
Moving the trait into `core` allows it to be added to the `num::Float` trait. I have also added and `assert_approx_eq!` macro. This is useful fo making approximate assertions on types that implement the `ApproxEq` trait. Examples: ~~~rust // using the default epsilon value assert_approx_eq!(1.0000001f, 1.0f); // using a custom epsilon value assert_approx_eq!(1.000001f, 1.0f, 1.0e-5); // fails with: "left: 1.00001 does not approximately equal right: 1" assert_approx_eq!(1.00001f, 1.0f); ~~~
Diffstat (limited to 'src/rt/rust_kernel.cpp')
0 files changed, 0 insertions, 0 deletions
