Possible Duplicate:
The most efficient way to implement an integer based power function pow(int, int)
How can I calculate powers with better runtime?
E.g. 2^13.
I remember seeing somewhere that it has something to do with the following calculation:
2^13 = 2^8 * 2^4 * 2^1
But I can't see how calculating each component o...
For example, does an operator exist to handle this?
float Result, Number1, Number2;
Number1 = 2;
Number2 = 2;
Result = Number1 (operator) Number2;
In the past the ^ operator has served as an exponential operator in other languages, but in C# it is a bit-wise operator.
Do I have to write a loop or include another namespace to handle...
how to simplify exponents in equations in sympy
from sympy import symbols
a,b,c,d,e,f=symbols('abcdef')
j=(a**b**5)**(b**10)
print j
(a**(b**5))**(b**10) #ans even after using expand simplify
# desired output
a**(b**15)
and if it is not possible with sympy which module should i import in python?
edit
even if i define 'b' as re...
I understand that y = x ^ n would be float y = (x, n)
but what if i wanted to draw the curves
y = 1 - x ^ 4
y = (1-x) ^ 4
y = 1-(1-x) ^ 4
Here's the code i wrote but it doesn't draw the curve mathematically correct for
y = 1 - x ^ 4
for (int x = 0; x < 100; x++) {
float n = norm(x, 0.0, 100.0);
float y = pow(1-n, 4);
y *= 100;...