Re: [Haskell-cafe] Desired behaviour of rounding etc.

2010-10-13 Thread Simon Marlow
On 12/10/2010 15:17, Daniel Fischer wrote: On Tuesday 12 October 2010 11:18:39, Simon Marlow wrote: On 09/10/2010 10:07, Daniel Fischer wrote: On Saturday 09 October 2010 06:34:32, Lennart Augustsson wrote: That code is incorrect. You can't assume that the base for floating point numbers is

Re: [Haskell-cafe] Desired behaviour of rounding etc.

2010-10-12 Thread Simon Marlow
On 09/10/2010 10:07, Daniel Fischer wrote: On Saturday 09 October 2010 06:34:32, Lennart Augustsson wrote: That code is incorrect. You can't assume that the base for floating point numbers is 2, that's something you have to check. (POWER6 and z9 has hardware support for base 10 floating

Re: [Haskell-cafe] Desired behaviour of rounding etc.

2010-10-12 Thread Daniel Fischer
On Tuesday 12 October 2010 11:18:39, Simon Marlow wrote: On 09/10/2010 10:07, Daniel Fischer wrote: On Saturday 09 October 2010 06:34:32, Lennart Augustsson wrote: That code is incorrect.  You can't assume that the base for floating point numbers is 2, that's something you have to check.

Re: [Haskell-cafe] Desired behaviour of rounding etc.

2010-10-09 Thread Daniel Fischer
On Saturday 09 October 2010 06:34:32, Lennart Augustsson wrote: That code is incorrect. You can't assume that the base for floating point numbers is 2, that's something you have to check. (POWER6 and z9 has hardware support for base 10 floating point.) -- Lennart Well, in light of -- We

[Haskell-cafe] Desired behaviour of rounding etc.

2010-10-08 Thread Daniel Fischer
The methods of the RealFrac class produce garbage when the value lies outside the range of the target type, e.g. Prelude GHC.Float truncate 1.234e11 :: Int -- 32-bits -1154051584 and, in the case of truncate, different garbage when the rewrite rule fires: Prelude GHC.Float double2Int

Re: [Haskell-cafe] Desired behaviour of rounding etc.

2010-10-08 Thread Lennart Augustsson
That code is incorrect. You can't assume that the base for floating point numbers is 2, that's something you have to check. (POWER6 and z9 has hardware support for base 10 floating point.) -- Lennart On Fri, Oct 8, 2010 at 2:08 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: The methods