1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3<head> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<title>MATHRandContext*</title> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</head> 10<body> 11<h1 align="left">MATHRandContext* <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<dl> 14 <dd> 15<PRE> 16<CODE>#include <nitro/math/rand.h><BR> 17typedef struct 18{ 19 u64 x ; 20 u64 mul ; 21 u64 add ; 22} 23MATHRandContext32; 24typedef struct 25{ 26 u32 x ; 27 u32 mul ; 28 u32 add ; 29} 30MATHRandContext16;</CODE></PRE> 31 </dd> 32</dl> 33<H2>Elements</H2> 34<TABLE width="100%" border=1> 35<TBODY> 36<TR> 37<TD width=300><EM><STRONG><FONT face="Courier New">x</FONT></STRONG></EM></TD> 38<TD width=700>The current random number value. The <CODE><A href="MATH_Rand.html">MATH_Rand*</A></CODE> functions get a value shifted from this number.</TD> 39 </TR> 40<TR> 41<TD><EM><STRONG><FONT face="Courier New">mul</FONT></STRONG></EM></TD> 42<TD>Stores the number that will be multiplied to get the next random number generated by the linear congruential method. This is initialized to a unique constant by the <CODE><A href="MATH_InitRand.html">MATH_InitRand*</A></CODE> functions, so if you change this value be sure to change this member afterward.</TD> 43 </TR> 44<TR> 45<TD><EM><STRONG><FONT face="Courier New">add</FONT></STRONG></EM></TD> 46<TD>Stores the number that will be added to get the next random number generated by the linear congruential method. This is initialized to a unique constant by the <CODE><A href="MATH_InitRand.html">MATH_InitRand*</A></CODE> functions, so if you change this value be sure to change this member afterward.</TD> 47 </TR> 48 </TBODY> 49</TABLE> 50<H2>Description</H2> 51<P>The context structure of random number generated by linear congruential method.</P> 52<P><CODE>MATHRandContext32</CODE> internally stores a 64-bit value and the <CODE><A href="MATH_Rand.html">MATH_Rand32</A></CODE> function gets a 32-bit random number. <CODE>MATHRandContext16</CODE> internally stores a 32-bit value and the <CODE><A href="MATH_Rand.html">MATH_Rand16</A></CODE> function gets a 16-bit random number.</P> 53<h2>See Also</h2> 54<P><a href="MATH_InitRand.html"><code>MATH_InitRand*</code></a><BR> <a href="MATH_Rand.html"><code>MATH_Rand*</code></a></P> 55<H2>Revision History</H2> 56<P>2004/12/13 Initial version.</P> 57<hr><p>CONFIDENTIAL</p></body> 58</html> 59