// These tests are based on those from sincosf.rs #[cfg(test)] mod tests { usesuper::sincos;
const TOLERANCE: f64 = 1e-6;
#[test] fn with_pi() { let (s, c) = sincos(core::f64::consts::PI);
assert!(
(s - 0.0).abs() < TOLERANCE, "|{} - {}| = {} >= {}",
s, 0.0,
(s - 0.0).abs(),
TOLERANCE
);
assert!(
(c + 1.0).abs() < TOLERANCE, "|{} + {}| = {} >= {}",
c, 1.0,
(s + 1.0).abs(),
TOLERANCE
);
}
#[test] fn rotational_symmetry() { use core::f64::consts::PI; const N: usize = 24; for n in0..N { let theta = 2. * PI * (n as f64) / (N as f64); let (s, c) = sincos(theta); let (s_plus, c_plus) = sincos(theta + 2. * PI); let (s_minus, c_minus) = sincos(theta - 2. * PI);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.