Solved

Exponents in C++

Posted on 2000-02-17
2
1,833 Views
Last Modified: 2010-05-18
How do you set an exponent to a number in C++?  
0
Comment
Question by:SBuntin
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 2532446
Did you look for

pow
Calculates x raised to the power of y.

double pow( double x, double y );


or


exp
Calculates the exponential.

double exp( double x );

(both in math.h)

I'm not sure which one you meant...
0
 

Expert Comment

by:Stevex2
ID: 2532465
I believe its one of these two you are looking for


x^y

or

x MOD y

believe they are included in the math.h file.

Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question