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

no-std ordered-float

Wrappers for total ordering on floats

45 releases (stable)

4.2.0 Dec 4, 2023
4.1.1 Oct 10, 2023
4.1.0 Sep 24, 2023
3.9.2 Oct 10, 2023
0.0.1 Nov 11, 2014

#8 in Rust patterns

Download history 697083/week @ 2024-01-10 733961/week @ 2024-01-17 748237/week @ 2024-01-24 786904/week @ 2024-01-31 806670/week @ 2024-02-07 814826/week @ 2024-02-14 860732/week @ 2024-02-21 923206/week @ 2024-02-28 889903/week @ 2024-03-06 926298/week @ 2024-03-13 925061/week @ 2024-03-20 916245/week @ 2024-03-27 924397/week @ 2024-04-03 919398/week @ 2024-04-10 975631/week @ 2024-04-17 795904/week @ 2024-04-24

3,797,059 downloads per month
Used in 2,962 crates (496 directly)

MIT license

88KB
2K 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.
  • bytemuck: Adds implementations for traits provided by the bytemuck crate.
  • borsh: Adds implementations for traits provided by the borsh crate.
  • rand: Adds implementations for various distribution types provided by the rand crate.
  • serde: Implements the serde::Serialize and serde::Deserialize traits.
  • schemars: Implements the schemars::JsonSchema trait.
  • proptest: Implements the proptest::Arbitrary trait.
  • 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.
  • speedy: Implements speedy's Readable and Writable traits.

License

MIT

Dependencies

~0.1–1.3MB
~25K SLoC