D
david.corby
I would like to know a few things about the pow() function.
1.) Is it an efficient way to raise a number to a given power for both
small and large numbers?
2.) How accurate is pow() when doing integer calculations? I'm
basically just going to use it to get powers of 10, but I can't have
pow(10, 6) == 999999 or 1000001 when I bring it back to an integer.
3.) Is there an integer-only version of pow in the STL that I'm missing
somewhere? I've found SGI's extension, and __gnu_cxx:ower, but I'm
trying to keep my code portable.
Thanks in advance,
Dave
1.) Is it an efficient way to raise a number to a given power for both
small and large numbers?
2.) How accurate is pow() when doing integer calculations? I'm
basically just going to use it to get powers of 10, but I can't have
pow(10, 6) == 999999 or 1000001 when I bring it back to an integer.
3.) Is there an integer-only version of pow in the STL that I'm missing
somewhere? I've found SGI's extension, and __gnu_cxx:ower, but I'm
trying to keep my code portable.
Thanks in advance,
Dave