#sorting #f64 #f32 #ord #order #wrapper #no-std

no-std ordered-float

Wrappers for total ordering on floats

40 stable releases (4 major)

4.5.0 Nov 3, 2024
4.3.0 Sep 25, 2024
4.2.2 Jul 29, 2024
4.2.0 Dec 4, 2023
0.0.1 Nov 11, 2014

#12 in Rust patterns

Download history 1300255/week @ 2024-08-08 1278130/week @ 2024-08-15 1321517/week @ 2024-08-22 1212634/week @ 2024-08-29 1351667/week @ 2024-09-05 1384767/week @ 2024-09-12 1463693/week @ 2024-09-19 1568067/week @ 2024-09-26 1515915/week @ 2024-10-03 1462341/week @ 2024-10-10 1499482/week @ 2024-10-17 1526273/week @ 2024-10-24 1381936/week @ 2024-10-31 1466346/week @ 2024-11-07 1567818/week @ 2024-11-14 1348123/week @ 2024-11-21

6,069,668 downloads per month
Used in 3,675 crates (579 directly)

MIT license

95KB
2.5K SLoC

ordered-float

Provides several wrapper types for Ord and Eq implementations on f64 and friends.

no_std

To use ordered_float without requiring the Rust standard library, disable the default std feature:

[dependencies]
ordered-float = { version = "4.0", default-features = false }

Optional features

The following optional features can be enabled in Cargo.toml:

  • arbitrary: Implements the arbitrary::Arbitrary trait.
  • borsh: Adds implementations for traits provided by the borsh crate.
  • bytemuck: Adds implementations for traits provided by the bytemuck crate.
  • derive-visitor: Adds implementations for traits provided by the derive-visitor crate.
  • num-cmp: Implements the num_cmp::NumCmp trait.
  • proptest: Implements the proptest::Arbitrary trait.
  • rand: Adds implementations for various distribution types provided by the rand crate.
  • rkyv_16: Implements rkyv's Archive, Serialize and Deserialize traits with size_16.
  • rkyv_32: Implements rkyv's Archive, Serialize and Deserialize traits with size_32.
  • rkyv_64: Implements rkyv's Archive, Serialize and Deserialize traits with size_64.
  • rkyv_ck: Implements the bytecheck::CheckBytes trait.
  • schemars: Implements the schemars::JsonSchema trait.
  • serde: Implements the serde::Serialize and serde::Deserialize traits.
  • speedy: Implements speedy's Readable and Writable traits.

License

MIT

Dependencies

~0.1–1.6MB
~30K SLoC