-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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); ~~~
- Loading branch information
Showing
15 changed files
with
389 additions
and
363 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.