#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

#10 in Rust patterns

Download history 1324106/week @ 2024-08-21 1213448/week @ 2024-08-28 1373968/week @ 2024-09-04 1355643/week @ 2024-09-11 1427266/week @ 2024-09-18 1554909/week @ 2024-09-25 1520541/week @ 2024-10-02 1469387/week @ 2024-10-09 1514626/week @ 2024-10-16 1521288/week @ 2024-10-23 1420849/week @ 2024-10-30 1436125/week @ 2024-11-06 1562450/week @ 2024-11-13 1439943/week @ 2024-11-20 1041808/week @ 2024-11-27 1076004/week @ 2024-12-04

5,384,796 downloads per month
Used in 3,741 crates (592 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.7MB
~33K SLoC