#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

#7 in Rust patterns

Download history 649370/week @ 2023-11-26 659542/week @ 2023-12-03 696236/week @ 2023-12-10 630125/week @ 2023-12-17 280378/week @ 2023-12-24 546085/week @ 2023-12-31 713890/week @ 2024-01-07 692671/week @ 2024-01-14 731551/week @ 2024-01-21 772295/week @ 2024-01-28 807547/week @ 2024-02-04 852777/week @ 2024-02-11 787338/week @ 2024-02-18 928330/week @ 2024-02-25 871801/week @ 2024-03-03 373995/week @ 2024-03-10

3,004,959 downloads per month
Used in 2,846 crates (485 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