{"id":33931688,"url":"https://github.com/vilcans/numquant","last_synced_at":"2026-04-05T17:37:28.621Z","repository":{"id":57647305,"uuid":"479872801","full_name":"vilcans/numquant","owner":"vilcans","description":"Rust crate to quantize numbers to a smaller range to save bandwidth or memory","archived":false,"fork":false,"pushed_at":"2025-03-31T20:52:03.000Z","size":29,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-13T23:32:06.676Z","etag":null,"topics":["crate","numeric","quantize"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vilcans.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}},"created_at":"2022-04-10T00:09:55.000Z","updated_at":"2025-03-31T20:52:07.000Z","dependencies_parsed_at":"2022-09-08T00:00:57.979Z","dependency_job_id":null,"html_url":"https://github.com/vilcans/numquant","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vilcans/numquant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilcans%2Fnumquant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilcans%2Fnumquant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilcans%2Fnumquant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilcans%2Fnumquant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vilcans","download_url":"https://codeload.github.com/vilcans/numquant/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilcans%2Fnumquant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31444702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T15:22:31.103Z","status":"ssl_error","status_checked_at":"2026-04-05T15:22:00.205Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["crate","numeric","quantize"],"created_at":"2025-12-12T12:56:32.833Z","updated_at":"2026-04-05T17:37:28.617Z","avatar_url":"https://github.com/vilcans.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# numquant\n\nQuantize numbers to a smaller range to save bandwidth or memory.\n\nThe input floating point value is expected to be within a given range. Values outside this range will be clamped. The input value will then be quantized into a given integer range.\n\nFor example, given the allowed range -1000.0 to 1000.0, and the quantized range 0 to 255 (to fit in a byte), the value -1000.0 would be quantized to 0, and 1000.0 would be quantized to 255, and values in-between are linearly interpolated between 0 and 255.\n\n## Example\n\nThis example uses the type `Q8\u003c0, 1000\u003e` that converts any floating point number between 0.0 and 1000.0 to a byte (which has the range 0 to 255). Some precision is lost, but an approximate value can be brought back.\n\n```rust\nuse numquant::Q8;\nlet original = 500.0;\n// Quantize the value into a byte between 0 and 255.\n// Quantization supports inputs between 0 and 1000.\ntype T = Q8::\u003c0, 1000\u003e;\nlet quantized = T::from_f64(original);\n// Convert it back to an f64\nlet dequantized = quantized.to_f64();\n// The conversion isn't lossless, but the dequantized value is close to the original:\napprox::assert_abs_diff_eq!(original, dequantized, epsilon = T::max_error());\n```\n\n## Links\n\n  * [Documentation](https://docs.rs/numquant)\n  * [crates.io](https://crates.io/crates/numquant)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvilcans%2Fnumquant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvilcans%2Fnumquant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvilcans%2Fnumquant/lists"}