<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nishiohirokazu</author_name>
  <author_url>https://blog.hatena.ne.jp/nishiohirokazu/</author_url>
  <blog_title>西尾泰和のはてなダイアリー</blog_title>
  <blog_url>https://nishiohirokazu.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>型はバイト幅だけじゃなくてどうやって二進法でエンコードするのかも規定するよね、という話をしていて確認のためのコードを書いた。手抜きをして方法Bでやってもいいよね、と思ったら予想外の結果が出たので悩んでいる。→解決 #include&lt;stdio.h&gt; int main(){ int i; float f = 1.0; /* 素直な方法 A (追記：やっちゃダメ！)*/ i = *(int*)(&amp;f); printf(&quot;A %d\n&quot;, i); /* 手抜きな方法 B */ printf(&quot;B %d\n&quot;, f); } Rubyでこんな感じに文字列化して、と。 irb&gt; def pp(x) x.t…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnishiohirokazu.hatenadiary.org%2Fentry%2F20110331%2F1301568313&quot; title=&quot;printf(&amp;quot;%d&amp;quot;, f)でfがfloatの時の挙動について - 西尾泰和のはてなダイアリー&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>2011-03-31 19:45:13</published>
  <title>printf(&quot;%d&quot;, f)でfがfloatの時の挙動について</title>
  <type>rich</type>
  <url>https://nishiohirokazu.hatenadiary.org/entry/20110331/1301568313</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
