diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-09-30 10:56:34 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-30 10:56:34 -0500 |
| commit | 643fcb98c0e6cdc63218dd39960d9053b209d9a6 (patch) | |
| tree | 6bddb7fe39b8fcc3ab3fb2665574533bb227898a /azalea-core/src/math.rs | |
| parent | a80d8d1b242430c4a251876fa67bfd26af7a0de9 (diff) | |
| download | azalea-drasl-643fcb98c0e6cdc63218dd39960d9053b209d9a6.tar.xz | |
1.21.9 (#235)
* start updating to 25w33a
* 1.21.9-pre2
* clippy
* cleanup, and fix c_explode and c_player_rotation
* mc update should be in Changed section in the changelog
* 1.21.9
Diffstat (limited to 'azalea-core/src/math.rs')
| -rw-r--r-- | azalea-core/src/math.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/azalea-core/src/math.rs b/azalea-core/src/math.rs index e62a3d23..4d3bf84c 100644 --- a/azalea-core/src/math.rs +++ b/azalea-core/src/math.rs @@ -92,6 +92,11 @@ pub fn sign_as_int(num: f64) -> i32 { if num == 0. { 0 } else { num.signum() as i32 } } +pub fn ceil_long(x: f64) -> i64 { + let x_i64 = x as i64; + if x > x_i64 as f64 { x_i64 + 1 } else { x_i64 } +} + pub fn equal(a: f64, b: f64) -> bool { (b - a).abs() < 1.0e-5 } |
