1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>MATH_InitRand*</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">MATH_InitRand* <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1>
15<H2>Syntax</H2>
16
17<dl>
18  <dd>
19  <PRE><CODE>#include &lt;nitro/math/rand.h&gt;
20
21static inline void MATH_InitRand32( <A href="MATHRandContext.html">MATHRandContext32</A> *context, u64 seed );</CODE></PRE>
22  <PRE><CODE>static inline void MATH_InitRand16( <A href="MATHRandContext.html">MATHRandContext16</A> *context, u32 seed );<BR>
23</CODE></PRE>
24  </dd>
25</dl><h2>Arguments</h2>
26
27<table border="1" width="100%">
28
29
30
31    <TR>
32      <TD width="176"><em><strong><font face="Courier New">context</font></strong></em></TD>
33      <TD width="670">Pointer to the random-number context being initialized.</TD>
34    </TR>
35    <TR>
36      <TD><em><strong><font face="Courier New">seed</font></strong></em></TD>
37      <TD>The Seed value for initialization.</TD>
38    </TR>
39  </table>
40<h2>Return Values</h2>
41<p>None.</p>
42<H2>Description</H2>
43<P>This function initializes the context of a random number generated using the linear congruential method. For a 32-bit random number, initialization is done using a multiplier of <nobr><code>0x5D588B656C078965</code></nobr> and an addend of <nobr><code>0x269EC3</code></nobr>. For a 16-bit random number, the multiplier is <nobr><code>0x5D588B65</code></nobr> and the addend is <nobr><code>0x269EC3</code></nobr>. To change these parameters, initialize and then make corrections to the members of the <code><a href="MATHRandContext.html">MATHRandContext*</a></code> structure.</P>
44<h2>See Also</h2>
45<P><a href="MATHRandContext.html"><code>MATHRandContext*</code></a>, <a href="MATH_Rand.html"><code>MATH_Rand*</code></a></P>
46<H2>Revision History</H2>
47<P>2004/12/13 Initial version.</P>
48<hr><p>CONFIDENTIAL</p></body>
49</html>
50