Hello Experts:
I was wondering if anyone knows how does a computer do exponents operations (powers).
I know its simple when the exponent is a positive integer.
a^b can be easily done with:
But what about the ones that work when exponent is a real number, like:
4^1.45 = 7.464263932
Any help will be greatly appreciated.
Kad.
I was wondering if anyone knows how does a computer do exponents operations (powers).
I know its simple when the exponent is a positive integer.
a^b can be easily done with:
Code:
c = 1
while b > 1 {
c = c * a
b = b - 1
}
return c
4^1.45 = 7.464263932
Any help will be greatly appreciated.
Kad.
Comment