<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>terai-s</author_name>
  <author_url>https://blog.hatena.ne.jp/terai-s/</author_url>
  <blog_title>Cogito Ergo Sum.</blog_title>
  <blog_url>https://terai-s.hatenadiary.org/</blog_url>
  <categories>
    <anon>プログラミング</anon>
  </categories>
  <description>プログラミング言語によって、整数同士の除算（割り算）の「余り」の演算結果が異なることには、数年前に気付いていた。主に、コンパイラ形式のC言語系か、インタプリタ形式のスクリプト言語系かで、全く異なるのだ。 例えば、C言語とGo言語で、 +1 % +3-1 % +3+1 % -3-1 % -3 の計算をすると、結果は 1-11-1 のようになる。ところが、RubyとPython3で同じ計算をすると、結果は、 12-2-1 のようになるのだ。 そのことには以前から気付いていたのだが、今回、そもそも整数除算の演算結果すら異なることに気付いた。 具体的には、 +3 / +3+2 / +3+1 / +3+…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fterai-s.hatenadiary.org%2Fentry%2F2023%2F12%2F27%2F132224&quot; title=&quot;商と余り - Cogito Ergo Sum.&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>2023-12-27 13:22:24</published>
  <title>商と余り</title>
  <type>rich</type>
  <url>https://terai-s.hatenadiary.org/entry/2023/12/27/132224</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
