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

no-std ordered-float

Wrappers for total ordering on floats

40 stable releases (4 major)

new 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

#9 in Rust patterns

Download history 1164074/week @ 2024-07-19 1165318/week @ 2024-07-26 1192869/week @ 2024-08-02 1300856/week @ 2024-08-09 1304356/week @ 2024-08-16 1334064/week @ 2024-08-23 1207546/week @ 2024-08-30 1351299/week @ 2024-09-06 1315579/week @ 2024-09-13 1584533/week @ 2024-09-20 1527155/week @ 2024-09-27 1537341/week @ 2024-10-04 1459663/week @ 2024-10-11 1495911/week @ 2024-10-18 1532670/week @ 2024-10-25 1100714/week @ 2024-11-01

5,878,941 downloads per month
Used in 3,624 crates (575 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