Crates.io | logprob |
lib.rs | logprob |
version | 0.2.0 |
source | src |
created_at | 2024-01-17 17:07:34.786252 |
updated_at | 2024-01-19 15:48:05.727646 |
description | A wrapper around floats to handle log probabilities |
homepage | |
repository | https://github.com/michaelgoodale/logprob/ |
max_upload_size | |
id | 1103265 |
size | 32,919 |
This crate defines a basic LogProb
wrapper for floats. The struct is designed so
that only values that are coherent for a log-probability are acceptable. This means that
LogProb
can store:
The crate is intended for careful implementations of computations involving log-probabilities.
LogProb
s (equivalent take the product of their corresponding raw probabilities)LogProb
and an unsigned integer (e.g. equivalent to p^n).Ord
and Eq
trait on LogProb
as there is no NaN
.For examples, see the documentation.