allow libm functions to work on Rational. fixes #3101