<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kuyata</author_name>
  <author_url>https://blog.hatena.ne.jp/kuyata/</author_url>
  <blog_title>tak0kadaの何でもノート</blog_title>
  <blog_url>https://takuyaokada.hatenablog.com/</blog_url>
  <categories>
    <anon>C、C++</anon>
  </categories>
  <description>project euler 66を解いていて力任せなコードでunsigned long型のxについてx2を計算したらオーバーフローしてしまった。 オーバーフロー検出としては以前利用したlimits.hをインクルードして、 #include&lt;limits.h&gt; if (x &gt; ULONG_MAX / x) return 1; とするか、gccなら-ftrapvオプションを利用する。exit codeについてはhttp://tldp.org/LDP/abs/html/exitcodes.htmlを見る。 メモ 手元で実行する場合は多倍長整数ライブラリというものを利用すると良さそう C++で多倍長整…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakuyaokada.hatenablog.com%2Fentry%2F20151021%2F1445358877&quot; title=&quot;整数のオーバーフロー対策 - tak0kadaの何でもノート&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>2015-10-21 01:34:37</published>
  <title>整数のオーバーフロー対策</title>
  <type>rich</type>
  <url>https://takuyaokada.hatenablog.com/entry/20151021/1445358877</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
