GistA:

So every variable in this calculation has to be a float variable!

If you want to calculate everything in floating point then you'll generally need at least one float variable per algebraic term.

So for example, given the code:

```
int a=2,b=3,c=4,d=5,e=6,f=7;
float g;
g = a/b + c/d + e/f;
```

You'd need to change to either

```
int a=2,b=3,c=4,d=5,e=6,f=7;
float g;
g = 1.0*a/b + 1.0*c/d + 1.0*e/f;
```

or

```
int a=2,b=3,c=4,d=5,e=6,f=7;
float g;
g = float(a)/b + float(c)/d + float(e)/f;
```

The first option is easier to type, but it does kind of leave a question mark over whether or not the compiler inserts a redundant multiplication. To be honest I've never verified it, but I very highly doubt that the multiplication would actually occur (and not be optimized away by the compiler).

So for example in your code the following would work:

**float(ge)***i/trans + float(geold)*(trans-i)/trans;

As would:

**1.0***ge*i/trans + 1.0*geold*(trans-i)/trans;