<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gct</author_name>
  <author_url>https://blog.hatena.ne.jp/gct/</author_url>
  <blog_title>つまみぐいメモ</blog_title>
  <blog_url>https://gct.hatenadiary.org/</blog_url>
  <categories>
    <anon>javascript</anon>
  </categories>
  <description>さくっと乱数が欲しい時にいつも方法を忘れるのでメモ。 Math.randomは0以上1未満のNumberを返す。 0以上4未満の乱数を得たければMath.random() * 4とする。整数として欲しければMath.floorを使う。 3以上7未満は0以上4(=7-3)未満に3を足せばOK。 0以上4以下の場合は？ 整数でよければ5未満と同じなのでMath.floor(Math.random() * 5)でOK。 整数でない場合、例えば0以上4.5以下とかは？Math.random() * 4.5では4.5にならない。 4.5 * 100000 = 4500000なので、4500000以下の整…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgct.hatenadiary.org%2Fentry%2F20100802%2F1280727003&quot; title=&quot;JavaScriptでの乱数メモ - つまみぐいメモ&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>2010-08-02 14:30:03</published>
  <title>JavaScriptでの乱数メモ</title>
  <type>rich</type>
  <url>https://gct.hatenadiary.org/entry/20100802/1280727003</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
