Added tests from documentation for rationals.