segfault on fromIntegral (floor $ sqrt (-123.123)) == -123.123

I'm getting a segfault on this expression entered into ghci: GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> fromIntegral (floor $ sqrt (-123.123)) == -123.123 Segmentation fault: 11 I'm running the 32-bit version of the Haskell Platform on OSX. Is this a bug? a problem with my setup? "Just don't take square roots of negative numbers - you should know better!"???

On Mon, Feb 24, 2014 at 2:46 PM, Erik Rantapaa
I'm getting a segfault on this expression entered into ghci:
GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> fromIntegral (floor $ sqrt (-123.123)) == -123.123 Segmentation fault: 11
I'm running the 32-bit version of the Haskell Platform on OSX.
Known bug with floating point on OS X. Not sure what the workaround is, but known to be fixed in 7.8.1 (which is in release candidate stage). -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (2)
-
Brandon Allbery
-
Erik Rantapaa