5 Topics

Member Avatar for
Member Avatar for Delightfully

def exponents(num1,num2): if (num2==0): return 1 else: return num1*exponents(num1,num2-1) Hey I was wondering how I can generate a list of exponents using a for loop or a while loop so that the numbers display like this: Input (2,3) Output 2,4,8 What I have so far only returns the answer, Please …

Member Avatar for TrustyTony
0
2K
Member Avatar for NickPatton

I'm working on an assignment where I have to write my own raisePower function to take a base and a power and compute the product. The assignment states that the function needs to return a long but all input/output values should be ints. The code compiles and runs but does …

Member Avatar for Caligulaminus
0
185
Member Avatar for Labdabeta

Is it possible to overload an operator for a built-in type? And if so what is it's syntax? EG: [CODE]//Use of overloaded operator^ for types double and double (assuming it is overloaded for exponent): double a=10.0; double b=2.5; double pow=a^b;//pow is approximately 316.22....[/CODE]

Member Avatar for L7Sqr
0
174
Member Avatar for DeIntegro

I understand that y = n ^ 4 will be pow(n,4)...but what about drawing the curve y = 1 - x ^ 4 y = (1 - x) ^ 4 y = 1-(1 - x) ^ 4 I appreciate your help. Thanks.

Member Avatar for DeIntegro
0
161
Member Avatar for sravan953

Hey all, I'm working on a program where I calculate powers of two upto 60. I've made my own formula for calculating it which is: 10^([value of log 2 here]*y), where 'y' is any power as big as, say, 31. So here it is: [code=python] two=0.301029995664 final=math.pow(10,(two*n))-1 [/code] Now... as …

Member Avatar for TrustyTony
0
190

The End.