Description
Implement Probability as a ValueObject in the primitives module.
Spec: f64 in range 0.0..=1.0
Implementation checklist
Implementation detail
Input / Output
|
Type |
Alias |
| Input |
f64 |
ProbabilityInput |
| Output |
f64 |
ProbabilityOutput |
Normalization
None.
Validation
- Must be finite (not NaN, not infinite).
- Must be in the range
0.0..=1.0 (inclusive on both ends).
Extra methods
None beyond the trait.
References
Description
Implement
Probabilityas aValueObjectin theprimitivesmodule.Spec:
f64in range 0.0..=1.0Implementation checklist
src/primitives/probability.rsValueObjecttrait#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]src/primitives/mod.rsandprelude# ExampleblockROADMAP.mdfrom ⬜ to ✅Implementation detail
Input / Output
f64ProbabilityInputf64ProbabilityOutputNormalization
None.
Validation
0.0..=1.0(inclusive on both ends).Extra methods
None beyond the trait.
References