P
Patrick McGovern
Hi, quick question that's driving me nvts. how do i do exponential math in
C#?
C#?
Patrick McGovern said:Hi, quick question that's driving me nvts. how do i do exponential math in
C#?
Nicholas Paldino said:Patrick,
Take a look at the static Pow method on the Math class.
The bad thing here is that it only takes doubles as an argument.
If you want to use integral values, you could always write the
algorithm yourself (looping through n times, multiplying the result by
itself).
Hope this helps.
Jon Skeet said:Use Math.Pow - there's no exponent operator in C# itself.
Nicholas Paldino said:If you want to use integral values, you could always write the algorithm
yourself (looping through n times, multiplying the result by itself).
Hope this helps.