This version of documentation is OUTDATED! Please switch to the latest one.

# Math Exponential Functions

## variableexp (variable arg)

Calculates the exponent of e.

### Arguments

• variable arg - Argument. Can be the following types:

### Return value

e raised to the power of arg. The type of returned value will depend on the argument type:
• float for int, long, float arguments
• double for double arguments
• vec4 for vec4 arguments
• dvec3 for dvec3 arguments
• dvec4 for dvec4 arguments

## variablelog10 (variable arg)

Base-10 logarithm.

### Arguments

• variable arg - Argument. Can be the following types:

### Return value

Base-10 logarithm of arg. The type of returned value will depend on the argument type:
• float for int, long, float arguments
• double for double arguments
• vec4 for vec4 arguments
• dvec3 for dvec3 arguments
• dvec4 for dvec4 arguments

## variablelog (variable arg)

Natural logarithm.

### Arguments

• variable arg - Argument. Can be the following types:

### Return value

Natural logarithm of arg. The type of returned value will depend on the argument type:
• float for int, long, float arguments
• double for double arguments
• vec4 for vec4 arguments
• dvec3 for dvec3 arguments
• dvec4 for dvec4 arguments

## variablepow (variable base, variable exp)

Exponential expression.

### Arguments

• variable base - Base. Can be the following types:
• variable exp - Power. The value can be of the following types:

### Return value

Base raised to the power of exp.

### Examples

Source code (UnigineScript)
printf("%s\n",typeinfo(pow(2.0,2.0)));
printf("%s\n",typeinfo(pow(vec3(2.0,3.0,4.0),2.0)));
printf("%s\n",typeinfo(pow(vec3(2.0,3.0,4.0),vec3(2.0,3.0,4.0))));
/*
result is:
float: 4
vec3: 4 9 16
vec3: 4 27 256
*/

## variablersqrt (variable arg)

Inverted square root.

### Arguments

• variable arg - Argument. Can be the following types:

### Return value

1.0 / sqrt(arg)
The type of returned value will depend on the argument type:
• float for int, long, float arguments
• double for double arguments
• vec4 for vec4 arguments
• dvec3 for dvec3 arguments
• dvec4 for dvec4 arguments

## variablesqrt (variable arg)

Square root.

### Arguments

• variable arg - Argument. Can be the following types:

### Return value

Square root of arg. The type of returned value will depend on the argument type:
• float for int, long, float arguments
• double for double arguments
• vec4 for vec4 arguments
• dvec3 for dvec3 arguments
• dvec4 for dvec4 arguments
Last update: 2017-07-03