aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-21 17:02:52 +0900
committernsfisis <nsfisis@gmail.com>2026-06-21 17:12:37 +0900
commit84fe6ac6977f15cbec85cbc9f773567742a7fb87 (patch)
tree5701e7c980585dd404471ab9fa53e98a0ba601ab /crates/shirabe-php-shim/src
parent12a7756588a20f1351e6976f0c009de5992514a9 (diff)
downloadphp-shirabe-84fe6ac6977f15cbec85cbc9f773567742a7fb87.tar.gz
php-shirabe-84fe6ac6977f15cbec85cbc9f773567742a7fb87.tar.zst
php-shirabe-84fe6ac6977f15cbec85cbc9f773567742a7fb87.zip
refactor(math): use method-style max/min/clamp over std::cmp
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src')
-rw-r--r--crates/shirabe-php-shim/src/math.rs24
1 files changed, 0 insertions, 24 deletions
diff --git a/crates/shirabe-php-shim/src/math.rs b/crates/shirabe-php-shim/src/math.rs
index ee9a76d..0d9090b 100644
--- a/crates/shirabe-php-shim/src/math.rs
+++ b/crates/shirabe-php-shim/src/math.rs
@@ -1,30 +1,6 @@
-pub fn max(a: i64, b: i64) -> i64 {
- a.max(b)
-}
-
-pub fn min(a: i64, b: i64) -> i64 {
- a.min(b)
-}
-
-pub fn abs(v: i64) -> i64 {
- v.abs()
-}
-
-pub fn floor(v: f64) -> f64 {
- v.floor()
-}
-
-pub fn ceil(v: f64) -> f64 {
- v.ceil()
-}
-
pub fn round(v: f64, precision: i64) -> f64 {
// PHP's default mode is PHP_ROUND_HALF_UP (round half away from zero),
// which matches Rust's f64::round.
let factor = 10f64.powi(precision as i32);
(v * factor).round() / factor
}
-
-pub fn intdiv(a: i64, b: i64) -> i64 {
- a / b
-}