gpt4 book ai didi

haskell - Int 和 Integer 有什么区别?

转载 作者:行者123 更新时间:2023-12-03 04:18:30 25 4
gpt4 key购买 nike

在 Haskell 中,IntInteger 之间有什么区别?答案记录在哪里?

最佳答案

"Integer" is an arbitrary precision type: it will hold any number no matter how big, up to the limit of your machine's memory…. This means you never have arithmetic overflows. On the other hand it also means your arithmetic is relatively slow. Lisp users may recognise the "bignum" type here.

"Int" is the more common 32 or 64 bit integer. Implementations vary, although it is guaranteed to be at least 30 bits.

来源:The Haskell Wikibook 。另外,您可能会找到Numbers Haskell 简介 的部分很有用。

关于haskell - Int 和 Integer 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3429291/

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