From 857f554689635b8bda8e970dc124cd52f6516083 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 12 Feb 2024 20:36:12 +0200 Subject: [PATCH] fix data types --- src/Tool.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Tool.php b/src/Tool.php index 4249bcf..9197741 100644 --- a/src/Tool.php +++ b/src/Tool.php @@ -34,14 +34,14 @@ class Tool while ($dec > $base - 1) { - $rest = bcmod( - $dec, - $base + $rest = bcmod( + (string) $dec, + (string) $base ); - $dec = bcdiv( - $dec, - $base + $dec = bcdiv( + (string) $dec, + (string) $base ); $value = $digits[$rest] . $value; @@ -89,15 +89,15 @@ class Tool ); $power = bcpow( - $base, - $size - $loop - 1 + (string) $base, + (string) ($size - $loop - 1) ); $dec = bcadd( $dec, bcmul( - $element, - $power + (string) $element, + (string) $power ) ); }