gpt4 book ai didi

haskell - Haskell 中的负 double 或 float (macports)

转载 作者:行者123 更新时间:2023-12-02 20:36:58 26 4
gpt4 key购买 nike

当我尝试显示负 double 或 float 时,为什么会出现段错误?负整数没有问题。

Prelude> let a = 4
Prelude> :t a
a :: Integer
Prelude> let b = -4
Prelude> b
-4
Prelude> :t b
b :: Integer
Prelude> let c = 5.6
Prelude> :t c
c :: Double
Prelude> let d = -5.6
Prelude> :t d
d :: Double
Prelude> show d
"-Segmentation fault

我尝试了各种方法,似乎数字被正确理解但没有显示。版本信息:

ghci --version
The Glorious Glasgow Haskell Compilation System, version 6.10.4

最佳答案

MacPorts 上的 GHC 似乎已损坏。请参阅https://trac.macports.org/ticket/25265

考虑从 haskell.org 安装 Haskell Platform,其中包括 GHC 6.12.3 和一系列 Haskell 好东西。

关于haskell - Haskell 中的负 double 或 float (macports),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4101599/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com