-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,112 additions
and
558 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,33 @@ | ||
# rust-nearly-eq | ||
[![crates.io badge](https://img.shields.io/crates/v/nearly-eq.svg)](https://crates.io/crates/nearly-eq) | ||
[![Build Status](https://travis-ci.org/chalharu/rust-nearly-eq.svg?branch=master)](https://travis-ci.org/chalharu/rust-nearly-eq) | ||
[![docs.rs](https://docs.rs/nearly_eq/badge.svg)](https://docs.rs/nearly_eq) | ||
[![Coverage Status](https://coveralls.io/repos/github/chalharu/rust-nearly-eq/badge.svg?branch=master)](https://coveralls.io/github/chalharu/rust-nearly-eq?branch=master) | ||
# rust-appro-eq | ||
|
||
Implementing the `NearlyEq` traits, Can asserts that the two expressions are nearly(approximately) equal to each other. | ||
[![crates.io badge](https://img.shields.io/crates/v/appro-eq.svg)](https://crates.io/crates/appro-eq) | ||
[![Build Status](https://travis-ci.org/chalharu/rust-appro-eq.svg?branch=master)](https://travis-ci.org/chalharu/rust-appro-eq) | ||
[![docs.rs](https://docs.rs/appro-eq/badge.svg)](https://docs.rs/appro_eq) | ||
[![Coverage Status](https://coveralls.io/repos/github/chalharu/rust-appro-eq/badge.svg?branch=master)](https://coveralls.io/github/chalharu/rust-appro-eq?branch=master) | ||
|
||
Implementing the `ApproEq` traits, Can asserts that the two expressions are approximately equal to each other. | ||
|
||
## How-to Use | ||
See the [crate documentation](https://docs.rs/nearly_eq/) for more details. | ||
|
||
See the [crate documentation](https://docs.rs/appro-eq/) for more details. | ||
|
||
### Examples | ||
|
||
```rust | ||
assert_nearly_eq!(1f64, 1.5f64, 0.6f64); // does not panic | ||
assert_nearly_eq!(0f64, 1e-12f64); // does not panic | ||
assert_appro_eq!(1f64, 1.5f64, 0.6f64); // does not panic | ||
assert_appro_eq!(0f64, 1e-12f64); // does not panic | ||
``` | ||
|
||
```rust:should_panic | ||
assert_nearly_eq!(1f64, 2f64); // panics | ||
assert_appro_eq!(1f64, 2f64); // panics | ||
``` | ||
|
||
### Optional Features | ||
|
||
- **`complex`** - Implement `NearlyEq` traits for `num_complex::Complex`. This adds a dependency on the `num-complex` crate. | ||
- **`complex`** - Implement `ApproEq` traits for `num_complex::Complex`. This adds a dependency on the `num-complex` crate. | ||
|
||
- **`rational`** - Implement `NearlyEq` traits for `num_rational::Ratio`. This adds a dependency on the `num-rational` crate. | ||
- **`rational`** - Implement `ApproEq` traits for `num_rational::Ratio`. This adds a dependency on the `num-rational` crate. | ||
|
||
- **`ndarray`** - Implement `NearlyEq` traits for `ndarray::ArrayBase`. This adds a dependency on the `ndarray` crate. | ||
- **`ndarray`** - Implement `ApproEq` traits for `ndarray::ArrayBase`. This adds a dependency on the `ndarray` crate. | ||
|
||
- **`i128`** - Implement `NearlyEq` traits for `i128` and `u128`. **Available only on Rust nightly channel.** | ||
- **`i128`** - Implement `ApproEq` traits for `i128` and `u128`. **Available only on Rust nightly channel.** |
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.