Use floats instead of ints

Fixes #1748