aliens

Author Topic: No damage dealt and silly armour penetration  (Read 11343 times)

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: No damage dealt and silly armour penetration
« Reply #15 on: December 03, 2014, 01:37:55 pm »
The most significant change is if the rounding rules makes it 2x less likely to obtain the maximum and minimum values.
i realized that and that thought brought the "(significant)" into my question :D
who makes randomfloat with just two decimals?
to be honest i dont want to know :)

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: No damage dealt and silly armour penetration
« Reply #16 on: December 03, 2014, 01:47:39 pm »
those numbers come about as a result of division by 100, as happens often when dealing with percentages.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: No damage dealt and silly armour penetration
« Reply #17 on: December 03, 2014, 02:58:43 pm »
But thats just implementation specifica the result is the same with both approaches (as far as i understood it) :)

Thanks Falko for saying what I was going to say! :) And thanks guys for the explanation on the details. It's interesting how rounding and computers affect mathematics!

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: No damage dealt and silly armour penetration
« Reply #18 on: December 03, 2014, 03:25:56 pm »
Yes, the arithmetics of computer integers doesn't have the same rules as the mathematical one.
Ex: this rounding up to a multiple of 8 :
x = (x +7) / 8 * 8

And floating-point arithmetics is yet again different.