Why does a segmentation error occur when I try to show a negative double or float? There are no problems for negative integers.
Prelude> let a = 4 Prelude> :ta a :: Integer Prelude> let b = -4 Prelude> b -4 Prelude> :tb b :: Integer Prelude> let c = 5.6 Prelude> :tc c :: Double Prelude> let d = -5.6 Prelude> :td d :: Double Prelude> show d "-Segmentation fault
I tried it in different ways, it seems that the number is correctly understood, but not shown. Version Information:
ghci --version The Glorious Glasgow Haskell Compilation System, version 6.10.4
source share