Actions
Bug #85741
closedBugfix for MathExpressionNode.php
Start date:
2018-08-03
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
8
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
/** * @param integer|float $left * @param string $operator * @param integer|float $right * @return integer|float */ protected static function evaluateOperation($left, $operator, $right) { if ($operator === '%') { return (float)$left % (float)$right; } elseif ($operator === '-') { return (float)$left - (float)$right; } elseif ($operator === '+') { return (float)$left + (float)$right; } elseif ($operator === '*') { return (float)$left * (float)$right; } elseif ($operator === '/') { return (integer) $right !== 0 ? (float)$left / (float)$right : 0; } elseif ($operator === '^') { return pow((float)$left, (float)$right); } return 0; }
Actions