[clean-list] Re: Functions that look the same (clean-list digest)
siegfried gonzi
siegfried.gonzi@kfunigraz.ac.at
Fri, 20 Jul 2001 20:40:19 +0200
----- Original Message -----
From: <clean-list-admin@cs.kun.nl>
> 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
Postscript.
I tried the same on my Macintosh (Power PC 603e).
In both cases I got as answer: 9.88131291682493e-324
I did a small C program with MPW (the Apple native C/C++ 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 only turns over the
double-results with 14 significant places.
S. Gonzi