Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   Using math functions (http://www.programmingforums.org/showthread.php?t=8662)

Kazy Mar 1st, 2006 6:43 PM

Using math functions
 
I need to calculate some function using e (the number e). I've been looking around and I can't figure out how to use it. I looked in math.h and didn't see anything useful. Also how do you correctly code exponents without just doing x*x*x*x.....? Thanks!

Kazy Mar 1st, 2006 6:44 PM

Just found the pow() function for the exponents.. still trying to figure out how to use e though.

Bench Mar 1st, 2006 7:01 PM

look at exp() for e^x

Navid Mar 1st, 2006 7:27 PM

I'm not sure what you mean by "the number e", but for exponents, pow(3,2) is equivalent to 3^2.

EDIT: Make sure that pow() uses arguments that are double or float type, they both must be the same type. It's return value is also a double or float type.

If you are going to display the output of pow(), make sure you use the %f specifier (if you are coding in C).


All times are GMT -5. The time now is 11:21 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC