aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes/Token/TokenDivision.php
Commit message (Collapse)AuthorAgeFilesLines
* Logicandcompare (#50)franksl2019-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * TokenFactory: allowing multicharacter tokens * Added logical and compare operators: <, <=, >, >=, ==, !=, ||, && * Fixed operator priorities * Error messages fixes * Fixed operators priority The priorities are assigned by following the php language standard (https://www.php.net/manual/en/language.operators.precedence.php) I've assigned precedence in steps of 10 units by following the linked page: 230 clone new 220 ** 210 ++ -- ~ (int) (float) (string) (array) (object) (bool) @ 200 instanceof 190 ! 180 * / % 170 + - . 160 << >> 150 < <= > >= 140 == != === !== <> <=> 130 & 120 ^ 110 | 100 && 90 || 80 ?? 70 ? : 60 = += -= *= **= /= .= %= &= |= ^= <<= >>= 50 yield from 40 yield 30 and 20 xor 10 or * Added if() function * Cache key fix There are cases where the cache key creation raised an error, for example while evaluating the expression "if(cos(2), cos(2), 0)", because the if() function was passing a float to the MathExecutor:execute() method.
* Fix single quotes parsing (#41)Alexander Kiryukhin2019-01-111-1/+1
| | | | | | | | | | * Fix single quotes parsing Fix e-mails Some small fixes * Mistake in test * More PHP versions
* Division By Zero Exception supportBruce Wells2018-10-311-0/+4
| | | | | | Updated the documentation. Unit tests for strings. DivisionByZeroException support.
* Removing DivisionByZeroException testing for nowBruce Wells2018-10-251-4/+0
| | | | Added more unit tests.
* Additional validation for bad expressions (*+ for example)Bruce Wells2018-10-241-0/+16
|
* Specifically check for 0 in division to allow for negative operationsbajb2016-04-011-1/+1
|
* Avoid division by zerobajb2016-04-011-1/+1
|
* Mass refactoringNeonXP2013-09-061-0/+54
Some changes: + Added support of functions with multiple arguments + Added some default function (min, max, avg). just example of multiple arguments :) - Removed variables support (I think they pointless) ~ All tokens now in individual classes ~ Parsing based on regular expressions ~ Fix negative numbers ~ Fix grouping with brackets