Skip to content

Commit

Permalink
Add documentation example of massive input
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard committed Sep 30, 2024
1 parent 0a7bc8b commit ad3f5d0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ assert_abs_diff_eq!(Ω, 0.56714329);
assert_abs_diff_eq!(mln4, -f32::ln(4.0));
```

The implementation can handle massive inputs just as well:

```rust
use lambert_w::lambert_w0;

let big = lambert_w0(f64::MAX);

assert_relative_eq!(big, 703.2270331047702, max_relative = 1e-15);
```

## License

Licensed under either of
Expand Down
20 changes: 18 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,24 @@ assert_abs_diff_eq!(mln4, -f32::ln(4.0));
"##
)]
//!
//! The macro is from the [`approx`](https://docs.rs/approx/latest/approx/) crate, and is used in the documentation examples of this crate.
//! The assertion passes if the two supplied values are the same to within floating point error, or within an optional epsilon.
//! The implementation can handle massive inputs just as well:
//!
#![cfg_attr(
feature = "50bits",
doc = r#"
```
# use approx::assert_relative_eq;
use lambert_w::lambert_w0;
let big = lambert_w0(f64::MAX);
assert_relative_eq!(big, 703.2270331047702, max_relative = 1e-15);
```
"#
)]
//!
//! The macros are from the [`approx`](https://docs.rs/approx/latest/approx/) crate, and are used in the documentation examples of this crate.
//! The assertion passes if the two supplied values are the same to within floating point error, or within an optional epsilon or relative difference.
//!
//! ## Features
//!
Expand Down

0 comments on commit ad3f5d0

Please sign in to comment.