Rational
Last updated
Was this helpful?
Last updated
Was this helpful?
Rational numbers are built-in, using , which provides a Perl interface to the mpq
layer in the library.
A numerical string can be converted into a rational number by using the Number
class:
The Number method as_rat
can be used for getting the rational form of a number: