New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #24670 (assigned defect)

Opened 3 years ago

Last modified 10 months ago

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

comment:1 Changed 3 years ago by jmr@…

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

Please remember to cc the maintainer.

comment:2 Changed 3 years ago by gwright@…

  • Status changed from new to assigned

comment:3 Changed 10 months ago by raimue@…

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

Port abandoned, #35561.

Note: See TracTickets for help on using tickets.