Please help me represent a mathematical function in C++

Feb 12, 2015 at 1:39pm
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
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
Feb 12, 2015 at 1:56pm
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.