Using powers based on user input
i noticed that C does not have an exponentiation operator. So i was wondering how does one add a power to variable which is based on user input? example:
Code:
int x; 
There's the function pow() (and associated powf() and powl()) in math.h.

ok, so use "e" is pretty chuffing confusing given e referes to the exponentiation function / inverse natural log. ^ would mean power normally, not exponent, so 2^5 is 25, not 200000, which is 2 x 10^5.
Use the math.h library, with the pow() function (which also contains exp() for the real e() function) 
understood, thanks for the answers :)

All times are GMT 5. The time now is 05:44 AM. 