SWI-Prolog / swipl-devel

SWI-Prolog Main development repository
http://www.swi-prolog.org
Other
959 stars 175 forks source link

library(error): unclear definition of between(L, U) #132

Closed edechter closed 8 years ago

edechter commented 8 years ago

Documentation specifies that between(L, U) is the type of number between L and U. But:

 ?- bash-3.2$ swipl
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.3.16-7-g69f2501)
Copyright (c) 1990-2015 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.

For help, use ?- help(Topic). or ?- apropos(Word).

?- is_of_type(between(1, 3), 2).
true.

?- is_of_type(between(1, 3), 2.2).
false.

?- is_of_type(number, 2.2).
true.
eazar001 commented 8 years ago

I think the definition is more according to:

is_of_type(positive_integer, 2.2)
false.
eazar001 commented 8 years ago

or actually, just ... just plain integer is more accurate.

edechter commented 8 years ago

Yes, and I think that's as it should be, given between/3. But if that's the intention the documentation should be updated to reflect that.

wouterbeek commented 8 years ago

Hi @edechter,

I believe this was recently updated. Can you check whether this now looks fine to you?

between(IntL,IntU): Integer [IntL..IntU] between(FloatL,FloatU): Number [FloatL..FloatU]`

edechter commented 8 years ago

Yes, it looks fine to me now.

Sent from my iPhone

On May 1, 2016, at 5:46 PM, Wouter Beek notifications@github.com wrote:

Hi @edechter,

I believe this was recently updated. Can you check whether this now looks fine to you?

between(IntL,IntU): Integer [IntL..IntU] between(FloatL,FloatU): Number [FloatL..FloatU]`

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub