Math.pow
Math member
Returns x raised to the power of y; x ** y is the same operation.
The signature, the sentence and any message are the compiler's own text at commit af54ddad5.
Syntax
Math.pow(base: number, exponent: number): numberA number in a parameter or a return position is the scalar slot. The ambient file declares a GPU scalar as a branded number whose brand is optional, so a literal and any branded scalar both fill it.
type f32 = number & { readonly [f32Tag]?: true }
A number you write as a type is inferred from its uses, and f32, i32 and u32 fix a width; the TypeScript constructs page carries that row with the compiler's emit.
Parameters
-
basenumber -
exponentnumber
Return value
number
Description
The GPU result is undefined when x is negative, when x is 1 and y is infinite, and when x is infinite and y is 0, and on GLSL ES 3.00 also when x is 0 and y is 0 or less. The CPU oracle gives JavaScript's special values (Math.pow(-2., 3.) is -8 and Math.pow(-2., 0.5) is NaN); a finite result is the compiler's own libm's, the same on every engine, and may differ from an engine's Math.pow in the last bit.