How to do exponentiation in clojure?

前端 未结 13 1801
执笔经年
执笔经年 2021-01-30 12:32

How can I do exponentiation in clojure? For now I\'m only needing integer exponentiation, but the question goes for fractions too.

相关标签:
13条回答
  • 2021-01-30 12:59
    user=> (.pow (BigInteger. "2") 10)
    1024
    user=> (.pow (BigInteger. "2") 100)
    1267650600228229401496703205376
    
    0 讨论(0)
提交回复
热议问题