Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Javascript Mathf.Ceil understanding problems

$
0
0
I use following code for a damage calculation all with floats: var Off_To_Def_Hits: float = Mathf.Ceil((OffForce - DefForce) / ((DefAgility * Defsize) / 2)); I used print to check the calculation. It say in this case: print("DmgCalc.: " + "DmgDiff: " + ((OffForce - DefForce)) + ", / Dodging= " + ((DefAgility * Defsize) / 2) + " Raw.OffToDefHits: " + Off_To_Def_Hits); Mathf.Ceil((117f - 48f) / 6f) = 5 ![alt text][1] But I expected 12! Wheres the problem?? [1]: /storage/temp/75993-dmgcalcfail.jpg

Viewing all articles
Browse latest Browse all 1875

Trending Articles