Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,826
    • Issues 4,826
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 440
    • Merge requests 440
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #5118

Closed
Open
Created 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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking