エントリーの編集
![loading...](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/common/loading@2x.gif)
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Why Python's Integer Division Floors
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
![アプリのスクリーンショット](https://b.st-hatena.com/bdefb8944296a0957e54cebcfefc25c4dcff9f5f/images/v4/public/entry/app-screenshot.png)
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Why Python's Integer Division Floors
I was asked (again) today to explain why integer division in Python returns the floor of the resu... I was asked (again) today to explain why integer division in Python returns the floor of the result instead of truncating towards zero like C. For positive numbers, there's no surprise: >>> 5//2 2 But if one of the operands is negative, the result is floored, i.e., rounded away from zero (towards negative infinity): >>> -5//2 -3 >>> 5//-2 -3 This disturbs some people, but there is a good mathemati