<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic unknown math function &amp;quot;rand&amp;quot; in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/unknown-math-function-quot-rand-quot/m-p/3185810#M163773</link>
    <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;I have a script that using rand function. When I tried to run it, I got an error below. Anyone know what the issue? Is there any patch need to be installed to resolve the issue? Please help. &lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;Negara&lt;BR /&gt;&lt;BR /&gt;unknown math function "rand"&lt;BR /&gt;    while executing&lt;BR /&gt;"expr {int($m*rand())}"&lt;BR /&gt;    (procedure "rand" line 3)&lt;BR /&gt;    invoked from within&lt;BR /&gt;"rand 2"&lt;BR /&gt;    invoked from within&lt;BR /&gt;"set isleft [rand 2]..."&lt;BR /&gt;    invoked from within&lt;BR /&gt;"set initially_left [set isleft [rand 2]]..."&lt;BR /&gt;    (file "./mkpasswd" line 108)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 09 Feb 2004 00:34:11 GMT</pubDate>
    <dc:creator>Dewa Negara_4</dc:creator>
    <dc:date>2004-02-09T00:34:11Z</dc:date>
    <item>
      <title>unknown math function "rand"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unknown-math-function-quot-rand-quot/m-p/3185810#M163773</link>
      <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;I have a script that using rand function. When I tried to run it, I got an error below. Anyone know what the issue? Is there any patch need to be installed to resolve the issue? Please help. &lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;Negara&lt;BR /&gt;&lt;BR /&gt;unknown math function "rand"&lt;BR /&gt;    while executing&lt;BR /&gt;"expr {int($m*rand())}"&lt;BR /&gt;    (procedure "rand" line 3)&lt;BR /&gt;    invoked from within&lt;BR /&gt;"rand 2"&lt;BR /&gt;    invoked from within&lt;BR /&gt;"set isleft [rand 2]..."&lt;BR /&gt;    invoked from within&lt;BR /&gt;"set initially_left [set isleft [rand 2]]..."&lt;BR /&gt;    (file "./mkpasswd" line 108)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Feb 2004 00:34:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unknown-math-function-quot-rand-quot/m-p/3185810#M163773</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2004-02-09T00:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: unknown math function "rand"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unknown-math-function-quot-rand-quot/m-p/3185811#M163774</link>
      <description>RAND(3)                    Linux Programmerâ  s Manual                   RAND(3)&lt;BR /&gt; &lt;BR /&gt;NAME&lt;BR /&gt;       rand, srand - random number generator.&lt;BR /&gt; &lt;BR /&gt;SYNOPSIS&lt;BR /&gt;       #include &lt;STDLIB.H&gt;&lt;BR /&gt; &lt;BR /&gt;       int rand(void);&lt;BR /&gt; &lt;BR /&gt;       void srand(unsigned int seed);&lt;BR /&gt; &lt;BR /&gt;DESCRIPTION&lt;BR /&gt;       The  rand()  function  returns  a  pseudo-random  integer between 0 and&lt;BR /&gt;       RAND_MAX.&lt;BR /&gt; &lt;BR /&gt;       The srand() function sets its argument as the seed for a  new  sequence&lt;BR /&gt;       of  pseudo-random  integers  to be returned by rand().  These sequences&lt;BR /&gt;       are repeatable by calling srand() with the same seed value.&lt;BR /&gt; &lt;BR /&gt;       If no seed value is provided,  the  rand()  function  is  automatically&lt;BR /&gt;       seeded with a value of 1.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Seems like a standard function to me.&lt;BR /&gt;&lt;BR /&gt;S&lt;/STDLIB.H&gt;</description>
      <pubDate>Mon, 09 Feb 2004 01:02:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unknown-math-function-quot-rand-quot/m-p/3185811#M163774</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-02-09T01:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: unknown math function "rand"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unknown-math-function-quot-rand-quot/m-p/3185812#M163775</link>
      <description>I'm a bit confused here, what language is this script written with?  It almost looks like shell but almost looks like C too.&lt;BR /&gt; &lt;BR /&gt;If you are using C then you need to include stdlib as SEP points out above.  If you are using shell, you need to use the $RANDOM (which is a bit rubbish really).  It looks like whichever language you are using here doesn't have the "rand()" function you are looking for.&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Mon, 09 Feb 2004 01:24:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unknown-math-function-quot-rand-quot/m-p/3185812#M163775</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-02-09T01:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: unknown math function "rand"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unknown-math-function-quot-rand-quot/m-p/3185813#M163776</link>
      <description>As Mark Grant said, this looks a bit like C but some parts read like a shell script... is this Perl?&lt;BR /&gt;&lt;BR /&gt;If it is, the next question will be: which version? "perl -v" will tell you that.&lt;BR /&gt;&lt;BR /&gt;Older releases of HP-UX 11.0 had a very old Perl version by default. There are depots of&lt;BR /&gt;Perl 5.6.1 and Perl 5.8 available for free at software.hp.com: look in "development tools".</description>
      <pubDate>Mon, 09 Feb 2004 04:55:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unknown-math-function-quot-rand-quot/m-p/3185813#M163776</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2004-02-09T04:55:05Z</dc:date>
    </item>
  </channel>
</rss>

