Opened 2 years ago

Last modified 19 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.6.2
Component: Compiler Version: 7.2.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets: 5688

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 (3)

comment:1 Changed 2 years ago by igloo

  • Difficulty set to Unknown
  • Milestone set to 7.6.1

comment:2 Changed 22 months ago by pcapriotti

  • Owner set to pcapriotti

comment:3 Changed 19 months ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2
Note: See TracTickets for help on using tickets.