[clean-list] Bug in infix operator

RT Happe rthappe@mathematik.uni-freiburg.de
Fri, 12 Apr 2002 17:01:37 +0200 (CEST)


On Fri, 12 Apr 2002, Willer Alves wrote:
> in Clean I've finally found the problem. The operation 0.0^0.0 (0.0 to the
> power of 0.0) returns #NAN instead of 1.0. This problem is just for Real
> types, I mean, 0^0 returns the correct result (1). How could I fix it?

You should fix your assumptions on correctness first.  Note that there's
no natural extension of the map (x,y) |--> x^y to [0,oo)x[0,oo), let alone
to the whole xy-plane.  You would have to sacrifice continuity and
algebraic relations.  In particular,

  0^eps = 0 for every positive eps, but
  eps^0 = 1 for every positive eps.

With these two facts quarreling about the proper value of 0^0, the authors of
the IEEE 754/IEC 559 floating point standard salomonically chose 0^0:=NaN.
(Actually, I don't recall wether this is required or only permitted.)

rthappe

PS:  I don't know what you can do about this in Clean.