From 26f49b7e27076e689541b9e13a1b54f60a4ee5c2 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 11 Jul 2024 02:57:23 +0900 Subject: feat: organize namespaces --- src/WebAssembly/Execution/NumericOps.php | 193 +++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 src/WebAssembly/Execution/NumericOps.php (limited to 'src/WebAssembly/Execution/NumericOps.php') diff --git a/src/WebAssembly/Execution/NumericOps.php b/src/WebAssembly/Execution/NumericOps.php new file mode 100644 index 0000000..895b8c2 --- /dev/null +++ b/src/WebAssembly/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