[clean-list] Re: (clean-list digest:) Functions that look the same (smithll)

Siegfried Gonzi siegfried.gonzi@kfunigraz.ac.at
Mon, 23 Jul 2001 15:23:21 +0200


clean-list-admin@cs.kun.nl wrote:

> From: smithll <smithll@cpsc.ucalgary.ca>
>
>
> reduce:: (Real -> Real)
> reduce = \x->x/10.0
>
> Start = until ((==)0.0 o \x->x/10.0) reduce 1.0
> will evaluate to 0
> while
> Start = until ((==)0.0 o reduce) (reduce) 1.0
> will evaluate to  0e-324
>
> This was done on win98 using Clean 1.3.3
>

Postscript:

I tried the same on my Macintosh (PowerPC 603e RISC).

In *both* cases I got as answer: 9.88131291682493e-324

I made a small C program with MPW (the native C/C++ Apple-compiler):

#include <stdio.h>
int main( void )
{
    double reduce1 = 1.0;
    double reduce2;
    do
    {
        reduce1 = reduce1/10.0;
        reduce2 = reduce1/10.0;
        printf("erg ist: %1.14e\n", reduce2);
    }while (reduce2 > 0.0)
}

That program delivers as results (notice %1.14e in printf):

...
9.88131291682493e-323
9.88131291682493e-324
0.00000000000000e+00

One thing bothers me is the observation that Clean turns over the
double-results with only 14 significant places (any documentation somewhere in
order to clarify this?).

Can someone execute the above 2 programs on Linux and with Clean?


S. Gonzi