N root Function?
BlitzMax Forums/BlitzMax Programming/N root Function?
| ||
Is there support for N Root maths in Blitzmax? e.g. Root(power, value) Regards Al |
| ||
By the power of mathsSuperStrict Print "Square root of 4 is " + nroot(4, 2) Print "Cube root of 27 is " + nroot(27, 3) Function nroot:Float(number:Float, n:Float) Return number ^ (1/n) End Function To find the n-th root of a number, raise that number to the power of 1/n. So 4 to the power of (1/2) is 2. |
| ||
Excellent, I now have the power! ;o) Cheers |