#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 687074/week @ 2023-12-07 675689/week @ 2023-12-14 379552/week @ 2023-12-21 415857/week @ 2023-12-28 677044/week @ 2024-01-04 689008/week @ 2024-01-11 746298/week @ 2024-01-18 741936/week @ 2024-01-25 788742/week @ 2024-02-01 841402/week @ 2024-02-08 785491/week @ 2024-02-15 880999/week @ 2024-02-22 921611/week @ 2024-02-29 896734/week @ 2024-03-07 937179/week @ 2024-03-14 747490/week @ 2024-03-21

3,669,605 downloads per month
Used in 2,878 crates (490 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