I'm working on a battle system for a turn-based RPG. Currently, it involves somewhat simple formulae: only int's and char's. I want to include floats for small modifications (mostly random between 0.5 and 0.7, for example). My question is this: if I mix float's and int's without any explicit casting, will my results be the expected values? For example (note this is not at all the formula I'm using):
uChar str = 60;
uChar dex = 84;
uChar weapon_atk = 125;
uChar enemy_def = 90;
uInt damage = ((str * dex) + weapon_atk)/enemy_def * /*random number between 0.5 and 0.7*/;
Am I correct in assuming that the random float will affect the outcome of the formula as I intend? Bascially, is this an unreliable method?
Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo