Common Math Object Methods
abs(x) - gets absolute value of x
ceil(x) - gets x rounded up to the nearest integer
floor(x) - gets x rounded up to the nearest integer
max(x,y,z,...) - gets the highest number of the arguments
min(x,y,z,...) - gets the lowest number of the arguments
pow(x,y) - gets x to the power of y
random() - generates random number between 0 and 1
round(x) - gets x rounded to the nearest integer
sqrt(x) - gets the square root of x
Your code will execute in this window.
Let's explore some more tutorials or topics!
YogiBuddhaTao69 Nov. 16, 2014, 12:09 a.m.@chekkal, True but I think you mean floor(x) - gets x rounded DOWN I love this site, but there are a lot of typographical errors. I almost wish that we could edit it like wiki, but of course that would compromise the integrity of such a modest site (relative to the traffic on wiki). Still, I wish there was a better way to fix typos than leave a comment, as I doubt the developer has the time to read them all.
chekkal Feb. 2, 2014, 12:20 p.m.The description of ceil and floor should be restated (the given definition is the same as round), as follow: ceil(x) - gets x rounded up to the nearest integer greater or equal to x floor(x) - gets x rounded up to the nearest integer lesser or equal to x