Re: AI basics not working?

OK, going to hazard a guess here as you haven't told us what type 'fx' etc are, but I'm assuming they're ints.

Since the right hand side of the calculation is a double, I'm also guessing that 'delta * 0.05' is less than 1 each time, this is being turned into an int.

When that happens the fraction element is remove.

So for the subtraction we have, eg, 10 - 0.1 = 9.9...remove the fraction gives us 9.

For addition we have 10 + 0.1 = 10.1...remove the fraction takes us back to 10.

So if you want to work with fractions than make all the variables double/float, then convert them when you use them, assuming they need to be ints at some point.

Re: AI basics not working?

Quote:

Originally Posted by

**Tolls** OK, going to hazard a guess here as you haven't told us what type 'fx' etc are, but I'm assuming they're ints.

Since the right hand side of the calculation is a double, I'm also guessing that 'delta * 0.05' is less than 1 each time, this is being turned into an int.

When that happens the fraction element is remove.

So for the subtraction we have, eg, 10 - 0.1 = 9.9...remove the fraction gives us 9.

For addition we have 10 + 0.1 = 10.1...remove the fraction takes us back to 10.

So if you want to work with fractions than make all the variables double/float, then convert them when you use them, assuming they need to be ints at some point.

ahh thank you very much; converted them to floats and it worked!