This page has been translated automatically.
UnigineScript
The Language
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Math Exponential Functions

variable exp (variable arg)

Calculates the exponent of e.

Arguments

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

variable log10 (variable arg)

Base-10 logarithm.

Arguments

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

variable log (variable arg)

Natural logarithm.

Arguments

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

variable pow (variable base, variable exp)

Exponential expression.

Arguments

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
*/

variable rsqrt (variable arg)

Inverted square root.

Arguments

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

variable sqrt (variable arg)

Square root.

Arguments

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
Build: ()