#### 2.17.1.6 Rational number syntax

As of version 8.1.22, SWI-Prolog supports rational numbers as a
primary citizen atomic data type if SWI-Prolog is compiled with the GMP
library. This can be tested using the bounded
Prolog flag. An atomic type also requires a syntax. Unfortunately there
are few options for adding rational numbers without breaking the ISO
standard.^{27ECLiSPe uses numerator_denominator.
This syntax conflicts with SWI-Prolog digit groups (see section
2.17.1.5) and does not have a recognised link to rational numbers.
The notation 1/3r and 1/3R have also been
proposed. The 1/3r is compatible to Ruby, but is hard to
parse due to the required look-ahead and not very natural. See also https://en.wikipedia.org/wiki/Rational_data_type.}

ECLiSPe and SWI-Prolog have agreed to define the canonical syntax for
rational numbers to be e.g., `1r3`

. In addition, ECLiSPe
accepts
`1_3`

and SWI-Prolog can be asked to accept `1/3`

using the module sensitive Prolog flag rational_syntax,
which has the values below. Note that write_canonical/1
always uses the compatible
`1r3`

syntax.

**natural**