Author Topic: How does Underrail handle decimals?  (Read 1142 times)

HulkOSaurus

  • Tchortist
  • ****
  • Posts: 314
  • Karma: +47/-32
    • View Profile
How does Underrail handle decimals?
« on: September 19, 2019, 01:50:27 pm »
How does Underrail even out decimal digits?

In particular, if you have 12 AP action cost, but reduce that by 39%. Would it be 5 or 6?

Maliel

  • Zoner
  • **
  • Posts: 50
  • Karma: +4/-0
    • View Profile
Re: How does Underrail handle decimals?
« Reply #1 on: September 19, 2019, 04:30:18 pm »
If it benefits you rounded down, if not rounded up

HulkOSaurus

  • Tchortist
  • ****
  • Posts: 314
  • Karma: +47/-32
    • View Profile
Re: How does Underrail handle decimals?
« Reply #2 on: September 19, 2019, 04:49:02 pm »
If it benefits you rounded down, if not rounded up

Ok, thanks.

HulkOSaurus

  • Tchortist
  • ****
  • Posts: 314
  • Karma: +47/-32
    • View Profile
Re: How does Underrail handle decimals?
« Reply #3 on: September 20, 2019, 08:06:33 am »
There's no clean rule for that, but usually decimal digits are truncated. Anything after the decimal point is just discarded. So for example 5.99 would be "rounded down" to 5 while -5.99 would be "rounded up" to -5. (On the technical side, the game usually just casts floats/doubles into ints.)

But there are exceptions, and AP cost is one of them. You can check the AP cost tables at https://www.underrail.com/wiki/index.php?title=Dexterity

Worth noting: if you calculate stuff by hand, the in-game math can be off by one from calculator results due to floating point rounding errors. Usually this won't matter, but with thresholds like AP costs or crafting skill requirements that one point could make all the difference.

Ok, thanks, man.

Time to stock on eel sandwiches.