This commit is contained in:
cano
2024-03-08 00:58:23 +08:00
parent bebbee4184
commit b14c000bc3
25 changed files with 1681 additions and 8 deletions

31
app/Tools/Math.php Normal file
View File

@ -0,0 +1,31 @@
<?php
namespace App\Tools;
class Math
{
const SCALE = 8;
const SCALE_4 = 4;
const SCALE_6= 6;
static function bcMul($a1,$a2,$scale = self::SCALE): string
{
return bcmul($a1,$a2,$scale);
}
static function bcSub($a1,$a2,$scale = self::SCALE): string
{
return bcsub($a1,$a2,$scale);
}
static function bcAdd($a1,$a2,$scale = self::SCALE): string
{
return bcadd($a1,$a2,$scale);
}
static function bcComp($a1,$a2,$scale = self::SCALE): string
{
return bccomp($a1,$a2,$scale);
}
}