spec_math 0.1.6

Rust implementations of special mathematical functions. Includes re-implementation of the CEPHES math library for gamma functions, error functions, elliptic integrals, sine and cosine integrals, fresnel integrals, normal distribution, and bessel functions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub fn gammasgn(x: f64) -> f64
{

    if x.is_nan() {
      x
    } else if x > 0.0 {
        1.0
    } else {
        let fx = x.floor();
        if x - fx == 0.0 {
            0.0
        } else if fx as isize % 2 != 0 {
            -1.0
        } else {
            1.0
        }
    }
}