I think you will have a hard time getting something related to block size accepted in the current climate.
Using floating point calculations in consensus code is a bad idea. The standard practice is to use very large integers to fake it. That has the advantage that it is exact. You don't even need to do this here.
Your get median function could just as easily use an array of integers. You are dividing by 2.0 and then getting casting it to int after using a floor function. The standard integer divide by 2 does that automatically.
The median function is sufficiently defined that I don't think you need the exact function (especially if you use integers).
Since the block size has to be an integer, even if the size was 1,234,567.5, the limit would still be 1,234,567.
It would likely help to gain acceptance if you added a 2nd limiter to the growth rate. For example, you could make it so that the size isn't allowed to more than double every year. This is similar to the 1MB limit on the lower end. A 45 day doubling time (granted subject to miner veto) is likely unacceptable. Miners could spam max size blocks by filling them with transactions created for that purpose.