Convert the Expr to a rational number or integer. The
function is similar to rational/1,
but the result is only accurate within the rounding error of floating
point numbers, generally producing a much smaller denominator.118The
as well as their semantics are inspired by Common Lisp.
?- A is rationalize(0.25).
A = 1 rdiv 4
?- A is rationalize(0.1).
A = 1 rdiv 10
Tag confusing pages with doc-needs-help|Tags are associated to your profile if you are logged in