2013-01-27から1日間の記事一覧
お前ら、Python3 だと、みんな大好き全角数字使えるの知ってた? >>> int('100') 100 >>> int('100') 100 >>> int('100', 16) 256 ってことは、これがエラーになるのはバグじゃないか? >>> int('FF', 16) Traceback (most recent call last): File "<stdin></stdin>…
Pythonで浮動小数点数を使って大きな値の計算をすると、 >>> 1e100 * 1e100 1e+200 >>> 1e200 * 1e200 inf >>> 1e200 ** 1e200 Traceback (most recent call last): File "<stdin>", line 1, in <module> OverflowError: (34, 'Numerical result out of range') >>> 1e1000 </module></stdin>…