Re: [prolog-standard] Re: log10/1, log/2, min/2, and max/2

From: Jan Wielemaker <>
Date: Thu, 16 Nov 2006 20:39:40 +0100

On Thursday 16 November 2006 19:37, Paulo Moura wrote:
> > Why is this desirable, when it leads to the problems indicated?
> > After all, this is an arithmetic function, so there is no reason
> > why it should not use the same floating-point contagion rule
> > like all other symmetric binary operations,
> Agree.

First of all, in practice min and max are rarely used with mixed types.
Second, most implementations providing unbounded integer arithmetic do
not provide unbounded floats, so max(2<<10000, 2.0) raises an error if
we promote the floats. Before that you may loose acuracy in the
unnecessary promotion to float. Select semantics avoids all these

> See the Jan reply he sent this morning. In the current version
> (5.6.23) the result also depends on the argument order, which I think
> is buggy behavior.

If you leave it undefined, there is no problem. I can't see realistic
scenarios where it matters.

        --- Jan

prolog-standard mailing list
Received on Mon Jul 14 2008 - 13:01:01 EST

This archive was generated by hypermail 2.2.0 : Wed Sep 08 2010 - 23:28:17 EST