Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rdf_literal_value/2 treats decimal numbers as floats #6

Open
wouterbeek opened this issue Aug 1, 2015 · 0 comments
Open

rdf_literal_value/2 treats decimal numbers as floats #6

wouterbeek opened this issue Aug 1, 2015 · 0 comments
Labels

Comments

@wouterbeek
Copy link
Contributor

rdf_literal_value/2 treats decimal numbers as floats:

?- rdf_literal_value(literal(type(xsd:decimal,'0.99999999999999999')), X).
X = 1.0.

Prolog supports rationals that can accurately represent decimal numbers, as used by plXsd:

?- xsd_lexical_map(xsd:float, '0.3333333333333333', X), Y is X * 3.
X = 0.3333333333333333,
Y = 1.0.

?- xsd_lexical_map(xsd:decimal, '0.3333333333333333', X), Y is X * 3.
X = 3333333333333333 rdiv 10000000000000000,
Y = 9999999999999999 rdiv 10000000000000000.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant