compute the simplest rational number in a real interval
SimplestRational( a, b )
realcons; real numbers with a<b
The SimplestRational( a, b ) command computes the "simplest" rational number pq such that a≤pq and pq≤b. It is "simplest" in the sense that p and q are as small as possible. (Note that an integer is considered to be "simpler" than a non-integral rational.)
If Maple is able to determine that b≤a, then an exception is raised.
with( NumberTheory ):
SimplestRational( 1/2, 3/4 );
SimplestRational( 1/2, 4/3 );
SimplestRational( Pi, Pi + Pi^(-10) );
SimplestRational( 9/10, 15/2 );
SimplestRational( sqrt( 1000 ), sqrt( 1001 ) );
SimplestRational( Pi, gamma );
Error, (in NumberTheory:-SimplestRational) first argument must be strictly less than the second
The NumberTheory[SimplestRational] command was introduced in Maple 2017.
For more information on Maple 2017 changes, see Updates in Maple 2017.
Download Help Document
What kind of issue would you like to report? (Optional)