Hi *,

I just ran into the following case:

> fromRat (-0 :: Rational) :: Double

0.0

> -0 :: Rational

0 % 1

How do I encode negative zero as a rational? The question come

up as `CmmFloat` is defined as `CmmFloat Rational Width` in

compiler/cmm/CmmExpr.hs. And my code generator thus turned

(Int, Rational) into a floating point expression, and when trying

to turn it into a `double` value, I ended up getting bad negative

zeros.

This makes me believe I can’t actually encode `-0` as a Rational,

and such `CmmFloat` will never contain `-0`?

Cheers,

Moritz

_______________________________________________

ghc-devs mailing list

[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs