Until rational numbers become first class citizens in SICStus Prolog, rational arithmetics has to be emulated. Because of the emulation it is too expensive to support arithmetics with automatic coercion between all sorts of numbers, like you find it in CommonLisp, for example.
You must choose whether you want to operate in the field of Q (Rationals) or R (Reals):
| ?- use_module(library(clpq)). or | ?- use_module(library(clpr)).
You can also load both modules, but the exported
predicates listed below will name clash
(see Importation). You can avoid the interactive resolution dialog
if the importation is skipped, e.g. via:
use_module(library(clpq),[]),use_module(library(clpr),[])
.