The evaluable function (^)/2.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The evaluable function (^)/2.

Jan Burse-3
Dear GNU Prolog Developer,

Accidentially, by some testing, I saw that GNU Prolog
produces the following results:

GNU Prolog 1.4.4 (64 bits)
Compiled Apr 23 2013, 16:05:07 with cl
?- X is 2^(-2).
X = 0
?- X is 2^(-1.5).
X = 0.35355339059327379

To my understanding supporting negative values and/or
non integer values for the second argument of (^)/2 is optional.

But returning zero in the first case above seems a little bit
odd to me. SWI Prolog produces the following results:

Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.3.10)
Copyright (c) 1990-2015 University of Amsterdam, VU Amsterdam
?- X is 2^(-2).
X = 0.25.
?- X is 2^(-1.5).
X = 0.3535533905932738.

Bye


_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog
Reply | Threaded
Open this post in threaded view
|

Re: The evaluable function (^)/2.

Jan Burse-3
Jan Burse schrieb:
> To my understanding supporting negative values and/or
> non integer values for the second argument of (^)/2 is optional.
Ups, sorry float types are also required:
https://www.complang.tuwien.ac.at/ulrich/iso-prolog/dtc2#pow

But there is also some dispute / errata:
http://eclipseclp.org/wiki/Prolog/IsoErrata

--
XLOG Technologies GmbH
Jan Burse
Freisch├╝tzgasse 14
8004 Z├╝rich
E-mail: [hidden email]
mobile: +41-76-489 04 03
fax: +41-43-268 04 03


_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog