{"id":33931748,"url":"https://github.com/jtempest/float_eq-rs","last_synced_at":"2026-04-04T12:57:42.809Z","repository":{"id":44768534,"uuid":"253131976","full_name":"jtempest/float_eq-rs","owner":"jtempest","description":"Compare IEEE floating point values for equality.","archived":false,"fork":false,"pushed_at":"2023-11-14T17:51:54.000Z","size":5500,"stargazers_count":42,"open_issues_count":5,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-13T23:37:15.708Z","etag":null,"topics":["floating-point","rust","testing"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jtempest.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-05T01:23:25.000Z","updated_at":"2025-06-20T18:09:20.000Z","dependencies_parsed_at":"2024-06-19T17:39:56.733Z","dependency_job_id":"4b92deea-800c-42df-9715-d58cf9a875fd","html_url":"https://github.com/jtempest/float_eq-rs","commit_stats":{"total_commits":250,"total_committers":3,"mean_commits":83.33333333333333,"dds":"0.020000000000000018","last_synced_commit":"3fa380ef8e2e86f10e66f17076c6269922a3359d"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/jtempest/float_eq-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtempest%2Ffloat_eq-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtempest%2Ffloat_eq-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtempest%2Ffloat_eq-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtempest%2Ffloat_eq-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtempest","download_url":"https://codeload.github.com/jtempest/float_eq-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtempest%2Ffloat_eq-rs/sbom","scorecard":{"id":539947,"data":{"date":"2025-08-11","repo":{"name":"github.com/jtempest/float_eq-rs","commit":"3fa380ef8e2e86f10e66f17076c6269922a3359d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/jtempest/float_eq-rs/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/jtempest/float_eq-rs/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/jtempest/float_eq-rs/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/jtempest/float_eq-rs/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/jtempest/float_eq-rs/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/jtempest/float_eq-rs/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/jtempest/float_eq-rs/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/jtempest/float_eq-rs/build.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/jtempest/float_eq-rs/build.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   7 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T07:57:51.236Z","repository_id":44768534,"created_at":"2025-08-20T07:57:51.237Z","updated_at":"2025-08-20T07:57:51.237Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31400460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["floating-point","rust","testing"],"created_at":"2025-12-12T12:58:41.689Z","updated_at":"2026-04-04T12:57:42.804Z","avatar_url":"https://github.com/jtempest.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n    THIS FILE IS GENERATED FROM crates-io.md, badges.md AND LICENSE.md.\n    DO NOT EDIT IT DIRECTLY.\n--\u003e\n\n# float_eq \n\n[![Build](https://github.com/jtempest/float_eq-rs/actions/workflows/build.yml/badge.svg)](https://github.com/jtempest/float_eq-rs/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/jtempest/float_eq-rs/branch/main/graph/badge.svg?token=QR20064LIR)](https://codecov.io/gh/jtempest/float_eq-rs)\n[![crate](https://img.shields.io/crates/v/float_eq.svg)](https://crates.io/crates/float_eq)\n[![documentation](https://docs.rs/float_eq/badge.svg)](https://docs.rs/float_eq)\n\nCompare IEEE floating point primitives, structs and collections for equality.\n\nThis crate provides an API with a focus on making the choices of comparison \nalgorithm(s) and tolerances intuitive to implementers and maintainers, and of\nproviding clear output for debugging and development iteration.\n\nThis readme is a quick tour of the crate. For introductory material, guides and\ndiscussion see [the float_eq guide].\n\n## Usage\n\nAdd this to your cargo.toml:\n\n```\n[dependencies]\nfloat_eq = \"1\"\n```\n\nAnd, if you're using the 2015 edition, this to your crate root:\n\n```rust\nextern crate float_eq;\n```\n\nThen, you can import items with `use`:\n\n```rust\nuse float_eq::{assert_float_eq, float_eq};\n```\n\n## Comparisons\n\nThis crate provides boolean comparison operations:\n\n```rust\nif (float_eq!(y_pos, 0.0, abs \u003c= 0.000_1)) {\n    //...\n}\n```\n\nAnd asserts:\n\n```rust\nconst RECIP_REL_TOL: f32 = 0.000_366_210_94;\nassert_float_eq!(x.recip(), 10.0, r2nd \u003c= RECIP_REL_TOL);\n```\n\nUsing absolute tolerance, relative tolerance or ULPs based [comparison\nalgorithms].\n\n## Composite types\n\nComposite types may implement the provided extension traits to be compared on a\nfield-by-field basis:\n\n```rust\nlet a = Complex32 { re: 2.0, im: 4.000_002 };\nlet b = Complex32 { re: 2.000_000_5, im: 4.0 };\n\nassert_float_eq!(a, b, ulps \u003c= ComplexUlps32 { re: 2, im: 4 });\n```\n\n...and if they are homogeneous, with a uniformly applied tolerance across all\nfields:\n\n```rust\nassert_float_eq!(a, b, ulps_all \u003c= 4);\n```\n\nArrays of any size are supported:\n\n```rust\nlet a = [1.0, -2.0, 3.0];\nlet b = [-1.0, 2.0, 3.5];\nassert_float_eq!(a, b, abs \u003c= [2.0, 4.0, 0.5]);\nassert_float_eq!(a, b, abs_all \u003c= 4.0);\n```\n\nAs are tuples up to size 12 (inclusive):\n\n```rust\nlet a = (1.0f32, 2.0f64);\nlet b = (1.5f32, -2.0f64);\nassert_float_eq!(a, b, r2nd \u003c= (0.5, 2.0));\n```\n\nMany standard and core types like `Vec` are supported:\n\n```rust\nlet a = vec![1.0, -2.0, 3.0];\nlet b = vec![-1.0, 2.0, 3.5];\nassert_float_eq!(a, b, rmax \u003c= vec![2.0, 2.0, 0.25]);\nassert_float_eq!(a, b, rmax_all \u003c= 2.0);\n```\n\nThere are blanket trait impls for comparing mutable and immutable reference\ntypes, the contents of `Cell`, `RefCell`, `Rc`, `Arc` and `Box` instances, as\nwell as for slices, `Option`, `Vec`, `VecDeque`, `LinkedList`, `BTreeMap` and\n`HashMap`.\n\n## Derivable\n\nThe extension traits may be derived for non-generic structs and tuple structs:\n\n```rust\n#[derive_float_eq(\n    ulps_tol = \"PointUlps\",\n    ulps_tol_derive = \"Clone, Copy, Debug, PartialEq\",\n    debug_ulps_diff = \"PointUlpsDebugUlpsDiff\",\n    debug_ulps_diff_derive = \"Clone, Copy, Debug, PartialEq\",\n    all_tol = \"f64\"\n)]\n#[derive(Debug, PartialEq, Clone, Copy)]\npub struct Point {\n    pub x: f64,\n    pub y: f64,\n}\n\nlet a = Point { x: 1.0, y: -2.0 };\nlet c = Point { \n    x: 1.000_000_000_000_000_9, \n    y: -2.000_000_000_000_001_3\n};\nassert_float_eq!(a, c, ulps \u003c= PointUlps { x: 4, y: 3 });\nassert_float_eq!(a, c, ulps_all \u003c= 4);\n```\n\n## Error messages\n\nAsserts provide additional useful context information. For example:\n\n```rust\nassert_float_eq!(4.0f32, 4.000_008, rmax \u003c= 0.000_001);\n```\n\nPanics with this error message:\n\n```\nthread 'main' panicked at 'assertion failed: `float_eq!(left, right, rmax \u003c= t)`\n        left: `4.0`,\n       right: `4.000008`,\n    abs_diff: `0.000008106232`,\n   ulps_diff: `Some(17)`,\n    [rmax] t: `0.000004000008`', assert_failure.rs:15:5\n```\n\nWhere `[rmax] t` shows the tolerance value that the absolute difference was\ncompared against after being appropriately scaled.\n\n## Optional features\n\nThis crate can be used without the standard library (`#![no_std]`) by disabling\nthe default `std` feature. Use this in `Cargo.toml`:\n\n```\n[dependencies.float_eq]\nversion = \"1\"\ndefault-features = false\n```\n\nOther optional features:\n- **derive** — provides custom derive macros for all traits.\n- **num** — blanket trait impls for `num::Complex` where it is instanced with a\n  compatible type.\n\n## Related efforts\n\nThe [`approx`], [`float-cmp`], [`assert_float_eq`] and [`is_close`] crates provide\nsimilar floating point comparison capabilities to `float_eq`. The [`almost`] crate\ndivides its API into comparison of floats against zero and non-zero values. The\n[`efloat`] crate provides an `f32` equivalent type that tracks the maximum\npossible error bounds that may have occured due to rounding.\n\nThe [`ieee754`] crate is not a comparison library, but provides useful\nfunctionality for decomposing floats into their component parts, iterating over\nrepresentable values and working with ULPs directly, amoung other things.\n\n## Contributing \n\nConstructive feedback, suggestions and contributions welcomed, please\n[open an issue].\n\n## Changelog\n\nRelease information is available in [CHANGELOG.md](CHANGELOG.md).\n\n[comparison algorithms]: https://jtempest.github.io/float_eq-rs/book/background/float_comparison_algorithms.html\n[open an issue]: https://github.com/jtempest/float_eq-rs/issues/\n[the float_eq guide]: https://jtempest.github.io/float_eq-rs/book/introduction.html\n[`almost`]: https://crates.io/crates/almost\n[`approx`]: https://crates.io/crates/approx\n[`assert_float_eq`]: https://crates.io/crates/assert_float_eq\n[`efloat`]: https://crates.io/crates/efloat\n[`float-cmp`]: https://crates.io/crates/float-cmp\n[`ieee754`]: https://crates.io/crates/ieee754\n[`is_close`]: https://docs.rs/is_close/latest/is_close/\n\n\u003cbr\u003e\n\n#### License\n\n\u003csup\u003e\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version\n2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\u003c/sup\u003e\n\n\u003cbr\u003e\n\n\u003csub\u003e\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in float_eq by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\u003c/sub\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtempest%2Ffloat_eq-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtempest%2Ffloat_eq-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtempest%2Ffloat_eq-rs/lists"}