float exp_decay float T_const float the argument might not make mathem

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
float exp_decay (float T_const, float t)
{
// the argument might not make mathematical sense (whatever.)
assert(!isnan(T_const));
assert(!isnan(t));
if (T_const <= 0.001) {
return 0.0;
} else {
float r = exp(- t / T_const);
assert(!isnan(r));
return r;
}
}