In the description it says the following functions are supported:
sin(), sinh(), arcsin(), asin(), arcsinh(), asinh(), cos(), cosh(), arccos(), acos(), arccosh(), acosh(), tan(), tanh(), arctan(), atan(), arctanh(), atanh(), pow(), exp(), sqrt(), abs(), ln(), log(), time(), ceil(), floor(), min(), max(), round()

But EvalMath.php only mentions:
'sin','sinh','arcsin','asin','arcsinh','asinh','cos','cosh','arccos','acos','arccosh','acosh','tan','tanh','arctan','atan','arctanh','atanh','sqrt','abs','ln','log'

So time(), ceil(), floor(), min(), max(), round() are not supported?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hansrossel created an issue. See original summary.

orkutmuratyilmaz’s picture

Version: 8.x-1.0-alpha1 » 2.x-dev
Component: Code » Documentation
Assigned: Unassigned » orkutmuratyilmaz
Category: Bug report » Task
Status: Active » Needs work

Confirmed, still accurate against 2.0.3. The underlying webit/eval-math library only registers sin/sinh/arcsin/asin/arcsinh/asinh, cos/cosh/arccos/acos/arccosh/acosh, tan/tanh/arctan/atan/arctanh/atanh, sqrt, abs, ln and log as built-ins, so time(), ceil(), floor(), min(), max(), round(), pow() and exp() are not available. Power is covered by the ^ operator.

min()/max()/round(x, n) cannot be added without patching the library, since built-in functions are limited to a single argument. Recategorising this as a documentation fix and correcting the supported-function list.

As a workaround, user-defined functions do accept multiple arguments:
min(a,b) = (a+b-abs(a-b))/2
max(a,b) = (a+b+abs(a-b))/2

orkutmuratyilmaz’s picture

Title: time(), ceil(), floor(), min(), max(), round() are not supported? » Update the supported functions in documentation
orkutmuratyilmaz’s picture

Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.