aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src/math.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-core/src/math.rs')
-rw-r--r--azalea-core/src/math.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/azalea-core/src/math.rs b/azalea-core/src/math.rs
index 105069ef..e62a3d23 100644
--- a/azalea-core/src/math.rs
+++ b/azalea-core/src/math.rs
@@ -92,6 +92,10 @@ pub fn sign_as_int(num: f64) -> i32 {
if num == 0. { 0 } else { num.signum() as i32 }
}
+pub fn equal(a: f64, b: f64) -> bool {
+ (b - a).abs() < 1.0e-5
+}
+
#[cfg(test)]
mod tests {
use super::*;