What is the correct formula for Timer Balls?

I was looking into the mechanics of Poké balls, and there's a lot of conflicting information about how the bonus from timer balls is calculated.

Earlier than Gen 5, everywhere agrees that the bonus starts at 1 and increases by 1 every 10 turns, to a maximum of 4 at t = 30.
Bulbapedia gives a continuous formula:

C = (10 + T) / 10 

but it's not clear whether that's supposed to be rounded down to the nearest integer.

From Gen 5 onwards, some places claim the calculation has changed to:

C = (1 + X * 1229/4096) 

However, the majority of sites only mention the other formula.

So are these two formulae correct for their respective generations? Are either of them rounded?


Generation III and IV

(("Amount of turns passed in battle" + 10) ÷ 10)x
[maximum 4×]

This means:

  • 1× if less than 10 turns have taken place
  • 2× if between 10 and 19 turns have taken place
  • 3× if between 20 and 29 turns have taken place
  • 4× if 30 or more turns have taken place

These are all rounded values.

As explained on Dragonflycave:

The Pokémon games prior to the fifth generation only work with integers. In practice, this essentially means that they round all numbers down, including at every intermediate step in a calculation.

Generation V and VI

(1 + "number of turns passed in battle" * 1229/4096)×
[maximum 4×]

This means you get approximately a 0.3 bonus each turn passed, up to 4x.

Other sources: Bulbapedia, Smogon, Thonky