adding floats

Hello All,
I am very new at c++ and ran into this problem.

pairPercentage = ((float)tempPair/hands) * 100;
flushPercentage = ((float)tempFlush/hands) * 100;
totalPairPercentage = pairPercentage + totalPairPercentage;

is there something I should be awared of when adding two float(s) ? because totalPairPercentage will always return pairPercentage, not its summation.

also did (totalPairPercentage += pairPercentage);

thank you
Maybe before the addition totalPairPercentage is set to zero?
actually it's adding like this...

adding totalPairPercentage 1.4013e-44 to pairPercentage 50.07

How can I convert totalPairPercentage ???

1.4013e-44 is a too little value. It does not influence on the value 50.07
Topic archived. No new replies allowed.