{"id":57287,"library":"ordered-float","title":"ordered-float","description":"Wrappers for total ordering on floats","status":"active","version":"5.3.0","language":"rust","source_language":null,"source_url":"https://github.com/reem/rust-ordered-float","tags":["float","ordering","wrapper","total-order","nan"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nordered-float = \"5.3.0\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add ordered-float","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"OrderedFloat","correct":"use ordered_float::OrderedFloat;"}],"quickstart":{"code":"use ordered_float::OrderedFloat;\nuse std::collections::BTreeSet;\n\nfn main() {\n    let mut set = BTreeSet::new();\n    set.insert(OrderedFloat(3.14));\n    set.insert(OrderedFloat(2.71));\n    set.insert(OrderedFloat(3.14)); // duplicate ignored\n    println!(\"Set: {:?}\", set);\n}","lang":"rust","description":"Use OrderedFloat to store floats in a BTreeSet with total ordering."},"warnings":[{"fix":"Ensure you handle NaN values explicitly or use `NotNan` wrapper if you want to reject NaN.","message":"OrderedFloat treats NaN as greater than all other values; this may cause unexpected ordering.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'float':3,9,10 'nan':16 'order':2,7,11,15 'ordered-float':1 'total':6,14 'total-ord':13 'wrapper':4,12","created_at":"2026-06-16T15:36:26.257293+00:00","updated_at":"2026-06-16T15:36:26.257293+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/reem/rust-ordered-float","github":"https://github.com/reem/rust-ordered-float","docs":"https://docs.rs/ordered-float/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}