Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 1st, 2006, 6:43 PM   #1
Kazy
Newbie
 
Join Date: Sep 2005
Posts: 21
Rep Power: 0 Kazy is on a distinguished road
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 is offline   Reply With Quote
Old Mar 1st, 2006, 6:44 PM   #2
Kazy
Newbie
 
Join Date: Sep 2005
Posts: 21
Rep Power: 0 Kazy is on a distinguished road
Just found the pow() function for the exponents.. still trying to figure out how to use e though.
Kazy is offline   Reply With Quote
Old Mar 1st, 2006, 7:01 PM   #3
Bench
Newbie
 
Join Date: Feb 2006
Posts: 20
Rep Power: 0 Bench is on a distinguished road
look at exp() for e^x
Bench is offline   Reply With Quote
Old Mar 1st, 2006, 7:27 PM   #4
Navid
Hobbyist Programmer
 
Navid's Avatar
 
Join Date: Feb 2005
Location: Canada
Posts: 187
Rep Power: 4 Navid is on a distinguished road
Send a message via MSN to Navid
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).

Last edited by Navid; Mar 1st, 2006 at 7:54 PM.
Navid is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:37 PM.

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