https://github.com/pacman82/unorm
https://github.com/pacman82/unorm
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pacman82/unorm
- Owner: pacman82
- License: mit
- Created: 2018-11-29T00:14:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-29T00:40:53.000Z (over 6 years ago)
- Last Synced: 2025-03-01T23:44:53.978Z (3 months ago)
- Language: Rust
- Size: 3.91 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
Unorm
=====An unsigned normalized real number type, able to represent numbers from zero to one (inclusive).
Usage
-----```rust
use unorm::Unorm;let probability_a = Unorm::from_rational(2,3);
let probability_b = Unorm::from_rational(1,3);
let probability_ab = probability_a * probability_b;
```Why you may not want to use it
------------------------------Multiplication of `Unorm` with `Unorm` is slow compared with `f64`. Many features you may want are
probably missing. Contributions are welcome though.Why you may want to use it
--------------------------Originally developed to represent probabilities in a small pet project of mine. Adding up `Unorm`
within a probability density function is fast and avoids some numeric issues.