<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>7.6.6. rand — groonga v1.2.6ドキュメント</title> <link rel="stylesheet" href="../_static/groonga.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '1.2.6', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/translations.js"></script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="top" title="groonga v1.2.6ドキュメント" href="../index.html" /> <link rel="up" title="7.6. 組み込み関数一覧" href="../functions.html" /> <link rel="next" title="7.7. Log" href="../log.html" /> <link rel="prev" title="7.6.5. now" href="now.html" /> </head> <body> <div class="header"> <h1 class="title"> <a id="top-link" href="../index.html"> <span class="project">groonga</span> <span class="separator">-</span> <span class="description">オープンソースのカラムストア機能付き全文検索エンジン</span> </a> </h1> <div class="other-language-links"> <ul> <li><a href="../../../en/html/functions/rand.html"><img src="../_static/us.png" alt="English"></a></li> </ul> </div> </div> <div class="related"> <h3>ナビゲーション</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="総合索引" accesskey="I">索引</a></li> <li class="right" > <a href="../log.html" title="7.7. Log" accesskey="N">次へ</a> |</li> <li class="right" > <a href="now.html" title="7.6.5. now" accesskey="P">前へ</a> |</li> <li><a href="../index.html">groonga v1.2.6ドキュメント</a> »</li> <li><a href="../reference.html" >7. リファレンスマニュアル</a> »</li> <li><a href="../functions.html" accesskey="U">7.6. 組み込み関数一覧</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="rand"> <h1>7.6.6. rand<a class="headerlink" href="#rand" title="このヘッドラインへのパーマリンク">¶</a></h1> <div class="section" id="id1"> <h2>7.6.6.1. 名前<a class="headerlink" href="#id1" title="このヘッドラインへのパーマリンク">¶</a></h2> <p>rand - 乱数を生成する</p> </div> <div class="section" id="id2"> <h2>7.6.6.2. 書式<a class="headerlink" href="#id2" title="このヘッドラインへのパーマリンク">¶</a></h2> <div class="highlight-none"><div class="highlight"><pre>rand([max]) </pre></div> </div> </div> <div class="section" id="id3"> <h2>7.6.6.3. 説明<a class="headerlink" href="#id3" title="このヘッドラインへのパーマリンク">¶</a></h2> <p>groonga組込関数の一つであるrandについて説明します。組込関数は、script形式のgrn_expr中で呼び出すことができます。</p> <p>rand() 関数は 0 から max の間の疑似乱数整数を返します。</p> </div> <div class="section" id="id4"> <h2>7.6.6.4. 引数<a class="headerlink" href="#id4" title="このヘッドラインへのパーマリンク">¶</a></h2> <p><tt class="docutils literal"><span class="pre">max</span></tt></p> <blockquote> <div>返値の最大値を指定します。省略した場合は RAND_MAX が指定されたものとみなされます。</div></blockquote> </div> <div class="section" id="id5"> <h2>7.6.6.5. 返値<a class="headerlink" href="#id5" title="このヘッドラインへのパーマリンク">¶</a></h2> <p>0 と max の間の数を表すInt32型の値を返します。</p> </div> <div class="section" id="id6"> <h2>7.6.6.6. 例<a class="headerlink" href="#id6" title="このヘッドラインへのパーマリンク">¶</a></h2> <div class="highlight-none"><div class="highlight"><pre>rand(10) 3 </pre></div> </div> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../index.html">目次</a></h3> <ul> <li><a class="reference internal" href="#">7.6.6. rand</a><ul> <li><a class="reference internal" href="#id1">7.6.6.1. 名前</a></li> <li><a class="reference internal" href="#id2">7.6.6.2. 書式</a></li> <li><a class="reference internal" href="#id3">7.6.6.3. 説明</a></li> <li><a class="reference internal" href="#id4">7.6.6.4. 引数</a></li> <li><a class="reference internal" href="#id5">7.6.6.5. 返値</a></li> <li><a class="reference internal" href="#id6">7.6.6.6. 例</a></li> </ul> </li> </ul> <h4>前のトピックへ</h4> <p class="topless"><a href="now.html" title="前の章へ">7.6.5. now</a></p> <h4>次のトピックへ</h4> <p class="topless"><a href="../log.html" title="次の章へ">7.7. Log</a></p> <h3>このページ</h3> <ul class="this-page-menu"> <li><a href="../_sources/functions/rand.txt" rel="nofollow">ソースコードを表示</a></li> </ul> <div id="searchbox" style="display: none"> <h3>クイック検索</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" size="18" /> <input type="submit" value="検索" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> モジュール、クラス、または関数名を入力してください </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>ナビゲーション</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="総合索引" >索引</a></li> <li class="right" > <a href="../log.html" title="7.7. Log" >次へ</a> |</li> <li class="right" > <a href="now.html" title="7.6.5. now" >前へ</a> |</li> <li><a href="../index.html">groonga v1.2.6ドキュメント</a> »</li> <li><a href="../reference.html" >7. リファレンスマニュアル</a> »</li> <li><a href="../functions.html" >7.6. 組み込み関数一覧</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009-2011, Brazil, Inc. </div> </body> </html>