Re: [Haskell-cafe] fast fractional part of floating point number - modf?

2008-01-15 Thread John Meacham
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

Re: [Haskell-cafe] fast fractional part of floating point number - modf?

2008-01-14 Thread Henning Thielemann
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

Re: [Haskell-cafe] fast fractional part of floating point number - modf?

2008-01-14 Thread John Meacham
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

[Haskell-cafe] fast fractional part of floating point number - modf?

2008-01-12 Thread Henning Thielemann
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