<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>toburau</author_name>
  <author_url>https://blog.hatena.ne.jp/toburau/</author_url>
  <blog_title>ゲームが作れるようになるまでがんばる日記</blog_title>
  <blog_url>https://toburau.hatenablog.jp/</blog_url>
  <categories>
    <anon>JavaScript</anon>
    <anon>TIPS</anon>
  </categories>
  <description>「enchant.jsスマートフォンゲーム開発講座」を読んでいたら、見慣れないコードが。 var r = randfloat(0,255)|0: randfloatは引数の範囲のランダムな値を返す関数で、その結果と0のorをrに代入している。これは色をランダムで求めている箇所のコード。0とのorを取って何か意味があるのだろうかと、orを取らないときと取ったときの演算結果を表示してみてどうなるか確かめてみた。 0とのorを取ることによって、小数点以下の値を切り捨てることが出来る。例えば、123.456なら123となる。 つまり上のコードなら、0から255までの整数値を得ることが出来る。と、いいた…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftoburau.hatenablog.jp%2Fentry%2F20121119%2F1353348687&quot; title=&quot;浮動小数点数から整数へ - ゲームが作れるようになるまでがんばる日記&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>2012-11-19 03:11:27</published>
  <title>浮動小数点数から整数へ</title>
  <type>rich</type>
  <url>https://toburau.hatenablog.jp/entry/20121119/1353348687</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
