Added bad implementation of to_ratio for floating