pub fn new(v: f64) -> Result<Self> {
        if v.is_nan() {
            Err(StatsError::BadParams)
        } else {
            Ok(Dirac(v))
        }
    }
///  Constructs a new dirac distribution function at value `v`.
///
/// # Errors
///
/// Returns an error if `v` is not-a-number.
///
/// # Examples
///
/// ```
/// use statrs::distribution::Dirac;
///
/// let mut result = Dirac::new(0.0);
/// assert!(result.is_ok());
///
/// result = Dirac::new(f64::NAN);
/// assert!(result.is_err());
/// ```
Constructs a new dirac distribution function at value `v`.
Constructs a new dirac distribution function at value ` v ` .
pub fn new(v: f64) -> Result<Self> {
        if v.is_nan() {
            Err(StatsError::BadParams)
        } else {
            Ok(Dirac(v))
        }
    }
pub fn new ( v : f64 ) -> Result < Self > { if v . is_nan ( ) { Err ( StatsError :: BadParams ) } else { Ok ( Dirac ( v ) ) } }
Constructs a new dirac distribution function at value `v`.
Constructs a new dirac distribution function at value ` v ` .
v
f64
v
f64
errors
Returns an error if `v` is not-a-number.
Returns an error if ` v ` is not - a - number .
examples
```
use statrs::distribution::Dirac.

let mut result = Dirac::new(0.0);
assert!(result.is_ok()).


` ` ` use statrs :: distribution :: Dirac . let mut result = Dirac :: new ( 0 . 0 ) ; assert! ( result . is_ok () ) .