From 61d6fdffb161c8b4130eb4982f021fbc0c77c445 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 9 Jul 2024 07:50:02 +0900 Subject: refactor: move some numeric operations to NumericOps class --- src/Execution/NumericOps.php | 193 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 src/Execution/NumericOps.php (limited to 'src/Execution/NumericOps.php') diff --git a/src/Execution/NumericOps.php b/src/Execution/NumericOps.php new file mode 100644 index 0000000..6fd19bf --- /dev/null +++ b/src/Execution/NumericOps.php @@ -0,0 +1,193 @@ +> 63) & 1) === 1 ? -1 : 1; + } elseif ($p !== 0.0) { + return $p < 0.0 ? -1 : 1; + } else { + // Comparison with 0 does not work for -0.0. + return fdiv(1, $p) < 0.0 ? -1 : 1; + } + } +} -- cgit v1.2.3-70-g09d2