Subject: Re: should float(10) succeed or fail?

From: Jan Wielemaker <[email-masked]>
Date: Mon, 13 Sep 1999 15:44:24 +0200

On Fri, 27 Aug 1999, Steffen Moeller wrote:
>Hi,
>
>the behaviour or float/1 is mathematical nonsense IMHO.
>Unless some ISO standard defines it this way I'd suggest
>to reimplement it to something that behaves like
>mathematical_float(X) :- float(X),!;integer(X).
>
>Other opinions?
>
>Many greetings
>
>Steffen
>
>With 3.2.9:
>
>1 ?- float(10).
>
>No
>2 ?- float(10.0).
>
>Yes    

As far as I know, it is how the standard defines it.  To test
for a number, use the Prolog predicate number/1:

?- number(1).
?- number(1.0).

both succeed.

	--- Jan