I’ve needed to access the maths functions in .NET for a few things recently and finally decided to create functions for the ones I use all the time. I’ve started with 3 functions and put them into a module. The good thing about this is that I can easily load them dynamically and any other modules I create can load this module.
Three functions defined so far.
pi returns the value of PI – 3.142…..
power raises a number to a particular power so
$x = power 3 3
is equivalent to 3*3*3
sqrt returns the square root of the number
if you want other roots use
power 1000 (1/3) to get the cube root – replace 3 by whatever root is required
I’ll add a few more tomorrow.