Why can Haskell handle very large numbers easily?

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


        
8条回答
  •  灰色年华
    2021-01-01 11:36

    You can use BigInteger to do the same thing. Haskell is a functional language which is more terse than Java.

    One reason we have so many languages is that different languages are better at different tasks as they were designed with different assumptions. Most functional languages are simpler with mathematical functions but tend to struggle with other use cases e.g. haskell is unlikely to be good choice for writing a GUI.

提交回复
热议问题