Why can Haskell handle very large numbers easily?

后端 未结 8 1872
遇见更好的自我
遇见更好的自我 2021-01-01 11:09
Hugs> 94535^445
13763208823213770506960538876615156211048901640052821530697264247739998018468419032448277029434879827074549660094560167350418780006041435009085328         


        
8条回答
  •  执笔经年
    2021-01-01 11:26

    The short and basic answer is that they implement default integers differents. In Java, a standard int is 32 bits. Signed, that gives you a range of −2,147,483,648 to +2,147,483,647.

    That said, Java has bignum classes too. If you use those, you'll also gain the ability to use arbitrarily large numbers.

提交回复
热议问题