unclear function /how dose it work.

double b_fn(double a, double t)
{
return (a == 0.0) ? t : (1.0 - std::exp(-a * t)) / a;
}


// please i need to know what dose and how this function dose, work? i can not understand any thing starting from return till then end.

Thank you for the help in advanced.
If a is zero, b_fn() returns t. If a is non-zero, b_fn() returns 1 - e-a t / a, where e is Euler's number.
thank you very much helios(13344).
Correction: If a is non-zero, b_fn() returns (1 - e-a t) / a.
closed account (48T7M4Gy)
http://en.cppreference.com/w/cpp/numeric/math/exp
Topic archived. No new replies allowed.