I was thinking to assume the capacity is always integer, but I guess it is not optimal. Math.round it now.