Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,384
    • Issues 4,384
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 368
    • Merge Requests 368
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #5118

Closed
Open
Opened Apr 14, 2011 by ClaudiusMaximus@trac-ClaudiusMaximus

Numeric.floatToDigits fails for large floatRange

I tried to write some high precision floating point datatype like this (corresponding to encodeFloat and decodeFloat format):

data HugeFloat = HugeFloat Integer Int

Mainly as an exercise to see how much slower it would be, but got failures trying to print the values (ghci would consume all available memory and be rather unresponsive w.r.t. ctrl-C input).

Changing this line in my RealFloat instance from:

  floatRange _ = (minBound, maxBound) -- fails

to:

  floatRange _ = (minBound `div` 2, maxBound `div` 2) -- works

made the non-termination failures seemingly disappear.

With attached code, ghci fails if I type:

  > 771 :: F1
Trac metadata
Trac field Value
Version 6.12.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC claudiusmaximus@goto10.org
Operating system
Architecture
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#5118