#24670: ghc 6.10.4_2 System.Random busted for floats/doubles on Snow Leopard --------------------------------+------------------------------------------- Reporter: waterson@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.2 Keywords: ghc random | Port: ghc --------------------------------+------------------------------------------- The System.Random functions (randomIO, randomRIO), when used with Double of Float, seem to consistently return Infinity. The expectation being that these would, of course, return random floating point numbers. For example, {{{ ~$ ghci GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> :m +System.Random Prelude System.Random> randomIO :: IO Double Loading package old-locale-1.0.0.1 ... linking ... done. Loading package old-time-1.0.0.2 ... linking ... done. Loading package random-1.0.0.1 ... linking ... done. Infinity Prelude System.Random> randomIO :: IO Float Infinity Prelude System.Random> randomRIO (0.0 :: Double, 1.0) Infinity Prelude System.Random> :q Leaving GHCi. ~$ }}} Integers do not seem to be affected. -- Ticket URL: <http://trac.macports.org/ticket/24670> MacPorts <http://www.macports.org/> Ports system for Mac OS