alright... i'm doing a battle system thing and I'm trying to revamp the whole battle class... here's a section of the formula I want to check:
Code:
...
int atk
...
int atkdam
...
atkdam=p2.atk*static_cast<double>((1+rand()%100)/100.0);
...
I was wondering if i got the casting right... I don't exactly remember the rules for float/int math... in this case, the atkdam is 1..100% of p2.atk... at least that's the way it should be working...
short version: Is this code doing what I want and how much of it is garbage?