/vendor/exprlib/src/exprlib/contexts/scope/Exp.php
https://bitbucket.org/furyfire/jabberbot · PHP · 18 lines · 14 code · 4 blank · 0 comment · 1 complexity · 93213fb39b087a12574ea58c165cf300 MD5 · raw file
- <?php
- namespace exprlib\contexts\scope;
- use exprlib\contexts\Scope;
- use exprlib\exceptions\ParsingException;
- class Exp extends Scope
- {
- public function evaluate()
- {
- if (is_array($result = parent::evaluate())) {
- throw new ParsingException('exp accept only one argument');
- }
- return (float) exp($result);
- }
- }