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

From: Richard A. O'Keefe <ok_at_cs.otago.ac.nz>
Date: Fri, 17 Nov 2006 15:35:50 +1300 (NZDT)

Jan Wielemaker <wielemak_at_science.uva.nl> wrote:
        I vote for log10.
        
Why? What advantage does log10(Y) have over log(10,Y)?

        min/max are *arithmetic* functions.

They are arithmetic functions ONLY in the sense that that's where they
will be put in the Prolog standard. Considered mathematically,
max and min belong to lattice theory (partial orders, total orders,
semi-lattices, lattices) not to arithmetic (groups, rings, fields, &c).

Floating-point contagion is a property of arithmetic operations NOT by
natural law or necessity but ONLY if we SAY it is. We have already seen
floating-point contagion blindly applied in a context where it ought not
to have been (numeric comparison); we should be fixing that blunder, not
handing it new conquests.

        I'd say the result of min(2, 2.0) is undefined (i.e. implementations
        can return either 2 or 2.0).
        
That's not undefined. That's _incompletely_ specified, but not undefined.

That might be a necessary compromise.

I note that Ada 95 manages very nicely without floating-point contagion
in any form, and is the better for it. Prolog would have been better if
we had required explicit conversions.

_______________________________________________
prolog-standard mailing list
prolog-standard_at_neve.di.ubi.pt
http://neve.di.ubi.pt/mailman/listinfo/prolog-standard
Received on Mon Jul 14 2008 - 13:01:02 EST

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