Skip to content

Commit

Permalink
Remove dependency on num-traits
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard committed Sep 30, 2024
1 parent f211ee6 commit 87e1adc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ documentation = "https://docs.rs/lambert_w"
[dependencies]
fast_polynomial = { version = "0.3.0", default-features = false, optional = true }
libm = { version = "0.2.8", optional = true }
num-traits = { version = "0.2", default-features = false, optional = true }

[dev-dependencies]
approx = { version = "0.5.1", default-features = false }
Expand All @@ -33,13 +32,13 @@ default = ["24bits", "50bits", "libm"]
# May result in slight numerical instability, which can be reduced if the target CPU has fused multiply-add instructions.
estrin = ["dep:fast_polynomial"]
# Expose the `LambertW0` and `LambertWm1` traits and their implementations.
traits = ["dep:num-traits"]
traits = []
# If the `std` feature is disabled, this feature uses the [`libm`](https://crates.io/crates/libm) crate
# to compute square roots and logarithms instead of the standard library.
libm = ["dep:libm", "fast_polynomial?/libm", "num-traits?/libm"]
libm = ["dep:libm", "fast_polynomial?/libm"]
# Use the standard library to compute square roots and logarithms for a potential performance gain.
# When this feature is disabled the crate is `no_std` compatible.
std = ["fast_polynomial?/std", "num-traits?/std"]
std = ["fast_polynomial?/std"]

[package.metadata.docs.rs]
# Document all features.
Expand Down
6 changes: 2 additions & 4 deletions src/traits.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use num_traits::Float;

/// Compute the principal branch of the Lambert W function.
pub trait LambertW0: Float {
pub trait LambertW0 {
/// The principal branch of the Lambert W funciton.
fn lambert_w0(self) -> Self;
}

/// Compute the secondary branch of the Lambert W function.
pub trait LambertWm1: Float {
pub trait LambertWm1 {
/// The secondary branch of the Lambert W funciton.
fn lambert_wm1(self) -> Self;
}
Expand Down

0 comments on commit 87e1adc

Please sign in to comment.