pow()

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

名称

pow()

示例
float
a = pow( 1, 3);

// Sets 'a' to 1*1*1 = 1float b = pow( 3, 5);

// Sets 'b' to 3*3*3*3*3 = 243float c = pow( 3,-5);

// Sets 'c' to 1 / 3*3*3*3*3 = 1 / 243 = .0041float d = pow(-3, 5);

// Sets 'd' to -3*-3*-3*-3*-3 = -243 
描述 Facilitates exponential expressions. The pow() function is an efficient way of multiplying numbers by themselves (or their reciprocals) in large quantities. For example, pow(3, 5) is equivalent to the expression 3*3*3*3*3 and pow(3, -5) is equivalent to 1 / 3*3*3*3*3.
语法
pow(n, e)
参数
n float: base of the exponential expression
e float: power by which to raise the base
返回值 float
相关 sqrt()

Updated on October 2, 2018 05:02:06pm EDT

pow()