integer_angles 0.2.0

Do math with angles, but represent them as integers to avoid using floats.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use integer_angles::Angle;
use nalgebra::RealField;

fn bench_cos_angle(c: &mut Criterion) {
    c.bench_function("cos_angle", |b| {
        b.iter(|| black_box(Angle::pi()).cos::<f64>())
    });
}

fn bench_cos_builtin(c: &mut Criterion) {
    c.bench_function("cos_buitin", |b| b.iter(|| black_box(f64::pi()).cos()));
}

criterion_group!(benches, bench_cos_angle, bench_cos_builtin);
criterion_main!(benches);