[clean-list] Re: (clean-list digest): Functions that look the same (Ronny Wichers Schreur)

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


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

> From: Ronny Wichers Schreur <ronny@cs.kun.nl>
>
>
> The Clean compiler tries to generate efficient code by passing
> arguments in registers. But in the case of floating point numbers
> the compiler's ability to keep values in registers can influence
> the result.
>
> See my message to the Haskell mailing list (archived at
> <http://www.mail-archive.com/haskell@haskell.org/msg05749.html>)
> for a similar and simpler example.
>

On my Macintosh (PowerPC RISC 603e) both programs delivers the same answer: -1075

According to your above message link to the haskell-mailing-list:

small powerOf2 exp
    | powerOf2 > 0.0 = small (powerOf2/2.0) (exp - 1)
    |otherwise = exp

and:

small powerOf2 exp
    | (\x->x) powerOf2 > 0.0 = small (powerOf2/2.0) (exp - 1)
    |otherwise = exp

Start = small 1.0 0


Please can anybody execute the stuff on Linux and Clean?


S. Gonzi