You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
implying anything else as an arg should generate an error. For example consider the definition...
abs/1 abs I, abs F
which takes both.
$ scryer-prolog
?- X is floor(1.2).
X = 1. % CORRECT
?- X is floor(1).
X = 1. % INCORRECT, should throw an error
?- X is abs(1.2).
X = 1.2. % CORRECT
?- X is abs(1).
X = 1. % CORRECT
Various Prologs are a mixed bag on this one.
The text was updated successfully, but these errors were encountered:
infradig
changed the title
floor takes an integer arg
floor happily takes an integer arg
Mar 22, 2025
Same for truncate/1, ceiling/1, round/1, floor/1. I think you @adri326 mentioned before that arithmetic evaluation could be implemented in an overall better way?
ISO standard section 9.1.1 says
implying anything else as an arg should generate an error. For example consider the definition...
which takes both.
$ scryer-prolog
?- X is floor(1.2).
X = 1. % CORRECT
?- X is floor(1).
X = 1. % INCORRECT, should throw an error
?- X is abs(1.2).
X = 1.2. % CORRECT
?- X is abs(1).
X = 1. % CORRECT
Various Prologs are a mixed bag on this one.
The text was updated successfully, but these errors were encountered: