Top "Pow" questions

pow is a function that exists in various programming languages that usually takes two numbers as input and returns the first number to the power of the second number.

Fastest way to obtain a power of 10

I'll use Java as an example here, as it may be completely language-specific, but I'm generally interested in ways to …

java math pow
How to use pow() in Swift 3 and get an Int

I have the following code: let lootBase = Int(pow((Decimal(level + 1)), 3) * 2) let lootMod = Int(pow(Decimal(level), 2) * 2) value = Int(arc4…

swift3 pow
Why pow(10,5) = 9,999 in C++

Recently i write a block of code: const int sections = 10; for(int t= 0; t < 5; t++){ int i = pow(sections, 5…

c++ mingw pow
Why is pow(int, int) so slow?

I've been working on a few project Euler exercises to improve my knowledge of C++. I've written the following function: …

c++ performance pow cmath
C# Math.Pow() is broken

And no, this does not (to my understanding) involve integer division or floating-point rounding issues. My exact code is: static …

.net math floating-point pow exponent
Wrong result by Java Math.pow

If you try to run the following code public class Main { public static void main(String[] args) { long a = (long)…

java math long-integer pow
Math.Pow is not calculating correctly

I'm having a problem with C#. To be precise with the Math.pow(). If I try to calculate 15^14 then I …

c# pow
return value of pow() gets rounded down if assigned to an integer

I am using the pow function in C and storing the return value in an integer type. see the code …

c pow
C: i got different results with pow(10,2) and pow(10,j), j=2;

this one prints 100: int j=2; int i= pow(10,2); printf("%d\n", i); and this one prints 99: int j=2; int i= …

c floating-point pow