Function babalcore::heaviside_step[][src]

pub fn heaviside_step(x: f64) -> f64

Heavyside step function as defined here: https://en.wikipedia.org/wiki/Heaviside_step_function It is 1 is x > 0, and 0 if x < 0.

Examples

use babalcore::*;

assert_eq!(0.0, heaviside_step(-0.5));
assert_eq!(0.5, heaviside_step(0.0));
assert_eq!(1.0, heaviside_step(0.5));