
#13232: Undeflow/overflow warnings for floating-point values -------------------------------------+------------------------------------- Reporter: lerkok | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by lerkok: @@ -14,1 +14,1 @@ - Prelude Data.Word> 1e5000 :: Float + Prelude> 1e5000 :: Float @@ -16,1 +16,1 @@ - Prelude Data.Word> 1e-5000 :: Double + Prelude> 1e-5000 :: Double New description: GHC nicely prints overflow warnings for bounded types: {{{#!hs Prelude Data.Word> 232312::Word8 <interactive>:2:1: warning: [-Woverflowed-literals] Literal 232312 is out of the Word8 range 0..255 120 }}} But the same courtesy isn't currently extended to floats: {{{ Prelude> 1e5000 :: Float Infinity Prelude> 1e-5000 :: Double 0.0 }}} It would be nice if overflow/underflow warnings were issued for floats as well. Note that with the hexadecimal floats proposal (https://github.com/LeventErkok/ghc- proposals/blob/hexFloats/proposals/0000-hexFloats.rst) this would be especially nice, making GHC a very fine platform for numeric computations. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13232#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler