
The HEAD seems to have a rounding bug: --------------------------------------------------------------------------- panne@jeanluc:~/hugs98-Dez2003/src> hugs __ __ __ __ ____ ___ _________________________________________ || || || || || || ||__ Hugs 98: Based on the Haskell 98 standard ||___|| ||__|| ||__|| __|| Copyright (c) 1994-2003 ||---|| ___|| World Wide Web: http://haskell.org/hugs || || Report bugs to: hugs-bugs@haskell.org || || Version: Dezember 2003 _________________________________________ Haskell 98 mode: Restart with command line option -98 to enable extensions Type :? for help Prelude> round (1799.0 :: Float) 1800 --------------------------------------------------------------------------- The released version gets this right. Investigating... Cheers, S.

I wrote:
The HEAD seems to have a rounding bug: [...]
FYI: The recent changes in the build system (probably by Ross and/or me) have somehow resulted in an complete breakage of floating point stuff, see below. Not sure what exactly goes wrong yet... Cheers, S. panne@jeanluc:/tmp/hugs98-Dez2003/src> ./hugs __ __ __ __ ____ ___ _________________________________________ || || || || || || ||__ Hugs 98: Based on the Haskell 98 standard ||___|| ||__|| ||__|| __|| Copyright (c) 1994-2003 ||---|| ___|| World Wide Web: http://haskell.org/hugs || || Report bugs to: hugs-bugs@haskell.org || || Version: Dezember 2003 _________________________________________ Haskell 98 mode: Restart with command line option -98 to enable extensions Type :? for help Prelude> 1.3 1,0

On Sun, Dec 07, 2003 at 08:08:52PM +0100, Sven Panne wrote:
I wrote:
The HEAD seems to have a rounding bug: [...]
FYI: The recent changes in the build system (probably by Ross and/or me) have somehow resulted in an complete breakage of floating point stuff, see below.
It was me.
Type :? for help Prelude> 1.3 1,0
It's the numeric part of your de_DE locale. I've changed it to only use the LC_CTYPE part. I don't see how this fouled up the original example (which doesn't happen in en_GB) though.

Ross Paterson wrote:
[...] It's the numeric part of your de_DE locale. I've changed it to only use the LC_CTYPE part. I don't see how this fouled up the original example (which doesn't happen in en_GB) though.
Fascinating. Everything works again now. I don't really have a clue how setlocale influenced my OpenGL stuff (via floats), though... %-] Thanks for the quick fix, S.

I wrote:
Fascinating. Everything works again now. I don't really have a clue how setlocale influenced my OpenGL stuff (via floats), though... %-]
Mystery solved: Hugs' native lexer uses atof, which in turn uses strtod, which is locale-dependent. In the German locale I use, ',' and not '.' is used between the integral and the fractional part of a numbers, so Hugs effectively lexed only the integral part. Thanks to Ross for fixing this obscure bug, S.
participants (2)
-
Ross Paterson
-
Sven Panne