1 2 3 4 5 6 7 8 9
float exp_decay (float T_const, float t) { if (T_const <= 0.001) { return 0.0; } else { float r = exp(- t / T_const); return r; } }