Add explicit cast from double to int
(fix msvc warning)