fixed overflow when converting fraction to float