<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yamaimo0625</author_name>
  <author_url>https://blog.hatena.ne.jp/yamaimo0625/</author_url>
  <blog_title>いものやま。</blog_title>
  <blog_url>https://yamaimo.hatenablog.jp/</blog_url>
  <categories>
    <anon>技術</anon>
    <anon>Python</anon>
  </categories>
  <description>前回のあらすじ： Pythonのビルトインのround()は普通の四捨五入とは違う偶数丸めというものだったので、floor()を使って普通の四捨五入を実装したよ。 誤差との戦い と、まぁ普通はここまでなんだけど、いろいろ試すと「あれ？」ってなるケースが出てくる。 具体的には、1.255を四捨五入して小数第二位までにしようとしたとき。 普通に考えれば小数第三位の数字が5なので切り上げられて1.26になると思うけど、残念ながらそうはならない。 myround2(1.255, 2) # =&gt; 1.25 ちなみに偶数丸めするround()ならこれは1.26になるはずなんだけど、試したらこうだった： r…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyamaimo.hatenablog.jp%2Fentry%2F2022%2F06%2F24%2F220000&quot; title=&quot;Pythonの四捨五入で四苦八苦した話。（その2） - いものやま。&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>2022-06-24 22:00:00</published>
  <title>Pythonの四捨五入で四苦八苦した話。（その2）</title>
  <type>rich</type>
  <url>https://yamaimo.hatenablog.jp/entry/2022/06/24/220000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
