22 require_once
'Services/Math/classes/class.ilMath.php';
23 require_once
'Services/Math/classes/class.EvalMath.php';
177 if(extension_loaded(
'bcmath'))
179 array_push($values, [
'4294967296',
'65536', self::DEFAULT_SCALE]);
211 [
'2.4742',
'2.47',
'2'],
212 [
'2.4762',
'2.48',
'2']
222 [
'1254',
'5298',
'6'],
223 [
'41414124',
'41414124',
'41414124']
237 [
'13/60',
'0.2166666666667',
'13'],
240 [
'(-(-41)-sqrt((-41)^2-4*(1)*(5)))/(2*(1))',
'0.122',
'3'],
241 [
'(-(-41)+sqrt((-41)^2-4*(1)*(5)))/(2*(1))',
'40.878',
'3'],
An exception for terminatinating execution or to throw for unit testing.
testEquals($a, $b, $result, $scale)
@dataProvider equalsData
testSqrt($a, $result, $scale)
@dataProvider sqrtData
testRound($a, $result, $scale)
@dataProvider roundData
testPow($a, $b, $result, $scale)
@dataProvider powData
testSub($a, $b, $result, $scale)
@dataProvider subData
testDiv($a, $b, $result, $scale)
@dataProvider divData
testMod($a, $b, $result)
@dataProvider modData
testMul($a, $b, $result, $scale)
@dataProvider mulData
testCalculation($formula, $result, $scale)
@dataProvider calcData
testGcd($a, $b, $result)
@dataProvider gcdData
testAdd($a, $b, $result, $scale)
@dataProvider addData
static _mod($left_operand, $modulus)
static _mul($left_operand, $right_operand, $scale=50)
static _round($value, $precision=0)
static _sqrt($operand, $scale=50)
static _div($left_operand, $right_operand, $scale=50)
static _pow($left_operand, $right_operand, $scale=50)
static _equals($value1, $value2, $scale)
static getGreatestCommonDivisor($a, $b)
static _sub($left_operand, $right_operand, $scale=50)
static _add($left_operand, $right_operand, $scale=50)