c++ coding (1 Viewer)

Rahul

Dead Member
Joined
Dec 14, 2002
Messages
3,647
Location
shadowy shadows
how would i code when a raise a variable to a power, whihc is also a variable, for eg: firstNumber^secondNumber

cheers
 

J0n

N/A
Joined
Aug 28, 2003
Messages
410
Gender
Male
HSC
2004
In C++, #include < cmath > and there is a Pow(x,y) function.
 

Protector

a little unsane
Joined
Nov 20, 2003
Messages
174
Location
Sydney
Gender
Male
HSC
2006
PHP:
#include <math.h>
  double pow( double base, double exp );
The pow() function returns base raised to the exp power. There's a domain error if base is zero and exp is less than or equal to zero. There's also a domain error if base is negative and exp is not an integer. There's a range error if there's an overflow.
http://www.cppreference.com/stdmath_details.html
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top