On Tue, Jan 15, 2008 at 07:40:03AM +0100, Henning Thielemann wrote:
>
> On Mon, 14 Jan 2008, John Meacham wrote:
>
> > On Sun, Jan 13, 2008 at 01:08:49AM +0100, Henning Thielemann wrote:
> > > Is there a fast and reliable way to compute the fraction of a floating
> > > point number?
> >
> > no, a
On Mon, 14 Jan 2008, John Meacham wrote:
> On Sun, Jan 13, 2008 at 01:08:49AM +0100, Henning Thielemann wrote:
> > Is there a fast and reliable way to compute the fraction of a floating
> > point number?
>
> no, and this has bothered me to the point I consider it a bug in the
> language spec that
On Sun, Jan 13, 2008 at 01:08:49AM +0100, Henning Thielemann wrote:
> Is there a fast and reliable way to compute the fraction of a floating
> point number?
no, and this has bothered me to the point I consider it a bug in the
language spec that all 'rounding' style functions give back an integral
Is there a fast and reliable way to compute the fraction of a floating
point number?
I can implement
fraction x = snd (properFraction x :: (Int, Double))
or
fraction x = x - fromIntegral (truncate x :: Int)
(actually I need 'floor' not 'truncate' but this is another issue)
but these nee