wavegen-rs icon indicating copy to clipboard operation
wavegen-rs copied to clipboard

Default Sawtooth has suspiciously high amount of bias

Open spitfire05 opened this issue 2 years ago • 0 comments

This code currently panics, the calculated bias is -0.00999999977

let wf = Waveform::<f32>::with_components(100.0, vec![sawtooth!(1)]);
let bias = wf.iter().take(100).sum::<f32>() / 100.0;
assert!(approx_eq!(f32, bias, 0.0, epsilon = 1e-3));

spitfire05 avatar Jul 07 '22 13:07 spitfire05