in my C++ code the line

Code: Select all

```
double Ulight = 1.3 / (1 - exp(-time_difference/(R*C)));
```

R and C are global constants (double), 220 and 1 respectively. The time_difference (long int) is measured by the program just before it gets to this calculation. It measured values around 34 (should be higher, but that is another issue), so Ulight should come to something like 9.078. But because of the minus I get a -inf.

I tried

Code: Select all

```
double x = -time_difference/(R*C)
double y = time_difference/(R*C)
```

x= 1.95226e+07

y = 0.154545

Does anyone have a clue why this happens and a piece of advice how to get the program working?

Thanks!