<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>KZE</author_name>
  <author_url>https://blog.hatena.ne.jp/KZE/</author_url>
  <blog_title>なにかのまねごと</blog_title>
  <blog_url>https://imitating-expressions.net/</blog_url>
  <categories>
    <anon>memo</anon>
    <anon>tech</anon>
  </categories>
  <description>何を今更みたいな話だけど、ハマったから書いておく。 if 0 p(&quot;hoge&quot;) end はhogeが出力される。 これは0が真偽値ではなく、オブジェクトとして存在していると解釈されるから。 なので、最下位ビットが1の時だけhogeと出力したくて次のコードを書いてもやりたいことが出来ない。 n = 5 while n &gt; 0 do if n &amp; 1 p(&quot;hoge&quot;) end n -= 1 end #&quot;hoge&quot;が5回表示される 正しくは n = 5 while n &gt; 0 do if (n &amp; 1) == 1 p(&quot;hoge&quot;) end n -= 1 end #&quot;hoge&quot;が3回表示される …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fimitating-expressions.net%2Fentry%2F20150213%2Fp1&quot; title=&quot;Rubyの真偽値 - なにかのまねごと&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-02-13 00:00:00</published>
  <title>Rubyの真偽値</title>
  <type>rich</type>
  <url>https://imitating-expressions.net/entry/20150213/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
