How to square and cube in DM in Developer Help
As the title states, how can I square or cube a number in Byond? I thought it was ** but perhaps I am wrong. Thanks.
1.2*P.Lvl**3 - 15*P.Lvl**2 + 100*P.Lvl - 140
mob verb check(Lvl as num) src << num2text(1.2*Lvl**3 - 15*Lvl**2 + 100*Lvl - 140, 25)
** is the exponent operator.
n**2 will give you the square of n, but n*n is faster.
n**3 wil lgive you the cube, but n*n*n is probably still faster.