Opened 15 years ago

Closed 11 years ago

#24670 closed defect (wontfix)

ghc 6.10.4_2 System.Random busted for floats/doubles on Snow Leopard

Reported by: waterson@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc:
Port: ghc

Description

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.

Change History (4)

comment:1 Changed 15 years ago by jmroot (Joshua Root)

Keywords: ghc random removed
Owner: changed from macports-tickets@… to gwright@…

Please remember to cc the maintainer.

comment:2 Changed 14 years ago by gwright@…

Status: newassigned

comment:3 Changed 12 years ago by raimue (Rainer Müller)

Owner: changed from gwright@… to macports-tickets@…

Port abandoned, #35561.

comment:4 Changed 11 years ago by neverpanic (Clemens Lang)

Resolution: wontfix
Status: assignedclosed

This ticket is obsolete, since GHC has been updated since.

Note: See TracTickets for help on using tickets.