Behavior of Python ** and % operators with big numbers

前端 未结 4 1266
一整个雨季
一整个雨季 2021-01-23 11:03

When I put in Python interpreter a ** b % c with large a (20 figures) b (4 figures) c (20 figures) I saw that Python calculates it pretty fast, almost like pow (a,b,c). I expect

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-23 11:51

    Today's computers are amazingly fast, very complicated calculations can occur in what seems like no time at all. You need to repeat such calculations very many times to see the delay; I'd start with a million.

提交回复
热议问题