cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Please help me represent a mathematical
Please help me represent a mathematical function in C++
Feb 12, 2015 at 1:39pm UTC
AceK
(61)
Hi all
I want to represent a Math equation in C++ but I am having some trouble doing that because the equation contains "e" for exponent and I dont know how to express that in C++. Here is the equation, y = (x*e EXP x) - 2
Feb 12, 2015 at 1:43pm UTC
LB
(13399)
https://en.wikipedia.org/wiki/E_%28mathematical_constant%29
Choose how precise you want to be, and stick it into a constant.
EDIT: Even better, consider keskiverto's post below.
Last edited on
Feb 12, 2015 at 2:05pm UTC
Feb 12, 2015 at 1:56pm UTC
keskiverto
(10402)
Is it really the constant e that is required, or something like:
http://en.cppreference.com/w/cpp/numeric/math/exp
Topic archived. No new replies allowed.