Opened 3 years ago

Last modified 4 months ago

#5692 new bug

Source code with large floating constants in exponential notation cannot be compiled

Reported by: gracjan Owned by: pcapriotti
Priority: normal Milestone: 7.12.1
Component: Compiler Version: 7.2.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: 5688 Differential Revisions:

Description

Source code cannot be compiled:

main = do
    print (123e124124124 :: Double)

where this one can be and will work after #5688 is fixed:

main = do
    print (read "123e124124124" :: Double)

Haskell Report forces Float and Double to go through Rational:

http://www.haskell.org/onlinereport/haskell2010/haskellch6.html#x13-1360006.4.1

When exponent is big it produces very large Rational numbers. That takes a lot of time and usually ends in out of memory condition.

This is similar to #5688, but at compile time.

Change History (5)

comment:1 Changed 3 years ago by igloo

  • difficulty set to Unknown
  • Milestone set to 7.6.1

comment:2 Changed 3 years ago by pcapriotti

  • Owner set to pcapriotti

comment:3 Changed 3 years ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2

comment:4 Changed 10 months ago by thoughtpolice

  • Milestone changed from 7.6.2 to 7.10.1

Moving to 7.10.1.

comment:5 Changed 4 months ago by thoughtpolice

  • Milestone changed from 7.10.1 to 7.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

Note: See TracTickets for help on using tickets.