Yitzchak Gale ha scritto:
[...]
Suppose we have a function
decodeIntegerAsFloat :: RealFloat a => Integer -> (Integer,a)
such that if (s,m) = decodeIntegerAsFloat x
then either x = 0 and s = 0 and m = 0
or x = m * 2**s (mathematically) and abs m \in [0.5,1.0).
Yes, that is what Manlio wants. Sometimes you need to divide
two very large Integers with a floating point number as result,
without the overhead of constructing a Rational from them.
By the way: it is possible to use a private constructor (via some
special GHC flag?).
I would like to do a quick performance check using the existing
fromRational specialization by constructing a Rational directly.
I know that Haskell allows declaration hiding for program safety, but
sometimes this can be a nuisance.
> [...]
Thanks Manlio Perillo
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe