MCPcopy Create free account
hub / github.com/Open-Quant/openquant / validate_positive

Function validate_positive

crates/openquant/src/strategy_risk.rs:271–276  ·  view source on GitHub ↗
(name: &'static str, value: f64)

Source from the content-addressed store, hash-verified

269}
270
271fn validate_positive(name: &'static str, value: f64) -> Result<(), StrategyRiskError> {
272 if !value.is_finite() || value <= 0.0 {
273 return Err(StrategyRiskError::InvalidInput(name));
274 }
275 Ok(())
276}
277
278fn validate_precision(precision: f64) -> Result<(), StrategyRiskError> {
279 if !precision.is_finite() || !(0.0..=1.0).contains(&precision) {

Callers 8

sharpe_symmetricFunction · 0.85
sharpe_asymmetricFunction · 0.85
kde_cdfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected