#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 694935/week @ 2024-01-05 689674/week @ 2024-01-12 746639/week @ 2024-01-19 747486/week @ 2024-01-26 794945/week @ 2024-02-02 862378/week @ 2024-02-09 773376/week @ 2024-02-16 913801/week @ 2024-02-23 895388/week @ 2024-03-01 897972/week @ 2024-03-08 950086/week @ 2024-03-15 922310/week @ 2024-03-22 936000/week @ 2024-03-29 885555/week @ 2024-04-05 935647/week @ 2024-04-12 815590/week @ 2024-04-19

3,757,171 downloads per month
Used in 2,952 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