The Book of Shaders by Patricio Gonzalez Vivo


Log2

Return the base 2 logarithm of the parameter

Declaration

float log2(float x)  
vec2 log2(vec2 x)  
vec3 log2(vec3 x)  
vec4 log2(vec4 x)

Parameters

x specify the value of which to take the base 2 logarithm.

Description

log2() returns the base 2 logarithm of x.

See Also

log, exp, exp2, Chapter 05: Shaping Functions