1.0.2 API documentation: Exponential functions

| 1.0.2 API documentation

Functions
Exponential functions
Core features

## Functions
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > | exp (vec< L, T, Q > const &v)
| Returns the natural exponentiation of v, i.e., e^v. More...
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > | exp2 (vec< L, T, Q > const &v)
| Returns 2 raised to the v power. More...
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > | inversesqrt (vec< L, T, Q > const &v)
| Returns the reciprocal of the positive square root of v. More...
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > | log (vec< L, T, Q > const &v)
| Returns the natural logarithm of v, i.e., returns the value y which satisfies the equation x = e^y. More...
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > | log2 (vec< L, T, Q > const &v)
| Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y. More...
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > | pow (vec< L, T, Q > const &base, vec< L, T, Q > const &exponent)
| Returns 'base' raised to the power 'exponent'. More...
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > | sqrt (vec< L, T, Q > const &v)
| Returns the positive square root of v. More...

## Detailed Description

Provides GLSL exponential functions

These all operate component-wise. The description is per component.

Include <glm/exponential.hpp> to use these core features.

## Function Documentation

## ◆ exp()

GLM_FUNC_DECL vec<L, T, Q> glm::exp | ( | vec< L, T, Q > const & | v | ) |

Returns the natural exponentiation of v, i.e., e^v.

Parameters

  v | exp function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier.

Template Parameters

  L | An integer between 1 and 4 included that qualify the dimension of the vector.
  T | Floating-point scalar types.

See also
  GLSL exp man page
  GLSL 4.20.8 specification, section 8.2 Exponential Functions

## ◆ exp2()

GLM_FUNC_DECL vec<L, T, Q> glm::exp2 | ( | vec< L, T, Q > const & | v | ) |

Returns 2 raised to the v power.

Parameters

  v | exp2 function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier.

Template Parameters

  L | An integer between 1 and 4 included that qualify the dimension of the vector.
  T | Floating-point scalar types.

See also
  GLSL exp2 man page
  GLSL 4.20.8 specification, section 8.2 Exponential Functions

## ◆ inversesqrt()

GLM_FUNC_DECL vec<L, T, Q> glm::inversesqrt | ( | vec< L, T, Q > const & | v | ) |

Returns the reciprocal of the positive square root of v.

Parameters

  v | inversesqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier.

Template Parameters

  L | An integer between 1 and 4 included that qualify the dimension of the vector.
  T | Floating-point scalar types.

See also
  GLSL inversesqrt man page
  GLSL 4.20.8 specification, section 8.2 Exponential Functions

## ◆ log()

GLM_FUNC_DECL vec<L, T, Q> glm::log | ( | vec< L, T, Q > const & | v | ) |

Returns the natural logarithm of v, i.e., returns the value y which satisfies the equation x = e^y.

Results are undefined if v <= 0.

Parameters

  v | log function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier.

Template Parameters

  L | An integer between 1 and 4 included that qualify the dimension of the vector.
  T | Floating-point scalar types.

See also
  GLSL log man page
  GLSL 4.20.8 specification, section 8.2 Exponential Functions

## ◆ log2()

GLM_FUNC_DECL vec< L, T, Q > log2 | ( | vec< L, T, Q > const & | v | ) |

Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y.

Returns the log2 of x for integer values.

Parameters

  v | log2 function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier.

Template Parameters

  L | An integer between 1 and 4 included that qualify the dimension of the vector.
  T | Floating-point scalar types.

See also
  GLSL log2 man page
  GLSL 4.20.8 specification, section 8.2 Exponential Functions

Useful to compute mipmap count from the texture size.

See also
  GLM_GTC_integer

## ◆ pow()

GLM_FUNC_DECL vec<L, T, Q> glm::pow | ( | vec< L, T, Q > const & | base,
|  | vec< L, T, Q > const & | exponent
| ) |  |

Returns 'base' raised to the power 'exponent'.

Parameters

  base | Floating point value. pow function is defined for input values of 'base' defined in the range (inf-, inf+) in the limit of the type qualifier.
  exponent | Floating point value representing the 'exponent'.

See also
  GLSL pow man page
  GLSL 4.20.8 specification, section 8.2 Exponential Functions

## ◆ sqrt()

GLM_FUNC_DECL vec<L, T, Q> glm::sqrt | ( | vec< L, T, Q > const & | v | ) |

Returns the positive square root of v.

Parameters

  v | sqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier.

Template Parameters

  L | An integer between 1 and 4 included that qualify the dimension of the vector.
  T | Floating-point scalar types.

See also
  GLSL sqrt man page
  GLSL 4.20.8 specification, section 8.2 Exponential Functions