<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>takeg</author_name>
  <author_url>https://blog.hatena.ne.jp/takeg/</author_url>
  <blog_title>ベスパリブ</blog_title>
  <blog_url>https://takeg.hatenadiary.jp/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>Python3</anon>
  </categories>
  <description>環境はPython3.6.5です。 まずは以下の計算結果を見てください。 gist.github.com なぜ？ float型において、有効数字が16桁以上の値を表現しようとすると誤差が生じてしまう可能性があるからです。 N//3 のような整数同士の切り捨て除算は内部処理的にint型のまま演算されるので（たぶん）、誤差が発生しないのだと思います。 よって、整数同士の切り捨て除算の場合、//演算子を使ったほうが誤差が発生する可能性が低いので、そちらを使ったほうが良いかもしれません。 調査と解説 以下は、詳しい解説になります。 まず、//演算子とmath.floor()の違いというか、それぞれがど…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakeg.hatenadiary.jp%2Fentry%2F2019%2F09%2F01%2F110530&quot; title=&quot;Python: 切り捨てはmath.floor()より//演算子を使ったほうが良いかも - ベスパリブ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-09-01 11:05:30</published>
  <title>Python: 切り捨てはmath.floor()より//演算子を使ったほうが良いかも</title>
  <type>rich</type>
  <url>https://takeg.hatenadiary.jp/entry/2019/09/01/110530</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
