rgchart 0.0.13

A library for parsing and writing rhythm game charts.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[inline(always)]
pub fn approx_eq(a: f32, b: f32, margin: f32) -> bool {
    (a - b).abs() <= margin
}

#[inline(always)]
pub fn thresholded_ceil(value: f32, threshold: f32) -> f32 {
    let fractional = value.fract();
    if fractional >= threshold {
        value.floor() + 1.0
    } else {
        value
    }
}