Exp function doesn't work in Math Expression Node

According to the documentation, in the math expression node, the ‘exp’ function should be available:

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/MathNode/

“Blueprint pure functions that are in a coded function library should all be available. These include:

-Exponential functions (square, power, sqrt, loge, e/exp, etc.)”

However, if I type exp(a) in a math expression node, it gives an error that it doesn’t recognize exp as a function.

The constant ‘e’ also doesn’t seem to be available, it just makes it a regular input node if I use ‘e’.

The ‘pow’ function does seem to work, so I can use: pow(2.72,a) to do it, but yeah as far as I can see, it’s a bug, or the documentation is wrong.

Hi BramV,

I may not be fully understanding the difficulty that you are having, though I think I might see where things could be confusing. If you are wanting to raise a base number to a power, then you would want to use the pow(x, y) expression for the Math Expression Node.

If you are looking for Euler’s Constant, you can get that using e(1) in the Math Expression Node. Where I suspect the confusion is coming in is that the expression e(x) in the Math Expression Node uses the same node that you would get if you searched for exp in the context menu of the Event Graph. Unfortunately the Math Expression Node does not parse exp(x) at all, and this is perhaps something that could be improved. In terms of the documentation though, “e” and “exp” are considered the same thing. This could probably be expressed a little more clearly as well.

If I have completely misunderstood what you were getting at, would you be able to further clarify the difficulty that you are experiencing?

1 Like

Just wanted to add for the c++ folks that there is an EULERS_NUMBER constant for example: ‘FMath::Pow(EULERS_NUMBER, …)’, from “UnrealMathUtility.h”.

I’m having a problem with cubic root, when I use Power (x, (1 / 3)), no matter what number I input, it always give “1” as an answer. How can I solve it?