NumberTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Number Theory : NumberTheory/SimplestRational

NumberTheory

  

SimplestRational

  

compute the simplest rational number in a real interval

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

SimplestRational( a, b )

Parameters

a, b

-

realcons; real numbers with a<b

Description

• 

The SimplestRational( a, b ) command computes the "simplest" rational number pq such that apq and pqb.  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 ba, then an exception is raised.

Examples

withNumberTheory&colon;

SimplestRational12&comma;34

12

(1)

SimplestRational12&comma;43

1

(2)

SimplestRationalπ&comma;π+π10

355113

(3)

SimplestRational910&comma;152

1

(4)

SimplestRationalsqrt1000&comma;sqrt1001

2538

(5)

SimplestRationalπ&comma;γ

Error, (in NumberTheory:-SimplestRational) first argument must be strictly less than the second

Compatibility

• 

The NumberTheory[SimplestRational] command was introduced in Maple 2017.

• 

For more information on Maple 2017 changes, see Updates in Maple 2017.

See Also

NumberTheory[ContinuedFraction]

type[realcons]