<Type Name="Random" FullName="System.Random" FullNameSP="System_Random" Maintainer="ecma">
  <TypeSignature Language="ILASM" Value=".class public serializable Random extends System.Object" />
  <TypeSignature Language="C#" Value="public class Random" />
  <MemberOfLibrary>BCL</MemberOfLibrary>
  <AssemblyInfo>
    <AssemblyName>mscorlib</AssemblyName>
    <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ]</AssemblyPublicKey>
    <AssemblyVersion>1.0.5000.0</AssemblyVersion>
    <AssemblyVersion>2.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement>
  <Base>
    <BaseTypeName>System.Object</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    <summary>
      <para> Generates
      psuedo-random numbers.</para>
    </summary>
    <remarks>
      <para> Instances of this class are initialized using a "seed",
      or starting value. The series of numbers
      generated by instances of the class are repeatable: given the
      same seed value,
      all instances of this class generate the same series of numbers.</para>
      <para>
        <block subset="none" type="note"> The numbers generated by this class are chosen with equal
      probability from a finite set of numbers. The numbers are generated by a
      definite mathematical algorithm and are therefore not truly random, but are
      sufficiently random for practical purposes. For this reason, the numbers are
      considered to be psuedo-random.
      </block>
      </para>
    </remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor()" />
      <MemberSignature Language="C#" Value="public Random ();" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters />
      <Docs>
        <summary>
          <para>Constructs a new instance of the
 <see langword="Random" /> class using <see cref="P:System.Environment.TickCount" qualify="true" />
 as the seed
 value.</para>
        </summary>
        <remarks>
          <para>This constructor is equivalent to <see cref="T:System.Random" />(<see cref="P:System.Environment.TickCount" /> ).</para>
          <para>
            <block subset="none" type="note">When generating 
 random numbers on high performance systems, the system clock value might not
 produce the desired behavior. For details, see the <see cref="T:System.Random" />(<see cref="T:System.Int32" />
 )
 constructor.</block>
          </para>
        </remarks>
      </Docs>
      <Excluded>0</Excluded>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="ILASM" Value="public rtspecialname specialname instance void .ctor(int32 Seed)" />
      <MemberSignature Language="C#" Value="public Random (int Seed);" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters>
        <Parameter Name="Seed" Type="System.Int32" />
      </Parameters>
      <Docs>
        <param name="Seed">A <see cref="T:System.Int32" /> used as the starting value for the pseudo-random number sequence.</param>
        <summary>
          <para>Constructs a new instance of the <see langword="Random" /> class using the specified
   seed value.</para>
        </summary>
        <remarks>
          <para>
            <block subset="none" type="note">To construct instances that produce different random number sequences, invoke
      this constructor using different seed values such as might be
      produced by the system clock. Note, however that on high performance systems, the system clock
      might not change between invocations of the constructor, in which case the seed value
      will be the same for different instances of <see langword="Random" /> . When this is the case, additional operations are required to have the seed values differ in each invocation.
   </block>
          </para>
        </remarks>
        <example>
          <para> The following example demonstrates using a
      bitwise complement operation to obtain different random numbers using a time-dependent
      seed value on high performance systems.</para>
          <code lang="C#">using System;
class RandomTest {
    public static void Main() {
        Random rand1 = new Random();
        Random rand2 = new Random(Environment.TickCount);
        Console.WriteLine("The random number is {0}",rand1.Next());
        Console.WriteLine("The random number is {0}",rand2.Next());

        Random rdm1 = new Random(unchecked(Environment.TickCount)); 
        Random rdm2 = new Random(~unchecked(Environment.TickCount)); 
        Console.WriteLine("The random number is {0}",rdm1.Next());
        Console.WriteLine("The random number is {0}",rdm2.Next());
    }
}
   </code>
          <c>
            <para>The output is </para>
            <para>The random number is 1990211954</para>
            <para>The random number is 1990211954</para>
            <para>The random number is 1990211954</para>
            <para>The random number is 964628126</para>
          </c>
        </example>
      </Docs>
      <Excluded>0</Excluded>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="Next">
      <MemberSignature Language="ILASM" Value=".method public hidebysig virtual int32 Next()" />
      <MemberSignature Language="C#" Value="public virtual int Next ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>
          <para>Returns a psuedo-random number between 0 and <see cref="F:System.Int32.MaxValue" />.</para>
        </summary>
        <returns>
          <para>A <see cref="T:System.Int32" /> greater than or equal to zero and less than
<see cref="F:System.Int32.MaxValue" />.</para>
        </returns>
        <remarks>
          <para>
            <block subset="none" type="behaviors">As described above.</block>
          </para>
          <para>
            <block subset="none" type="overrides">Override this method to customize the algorithm used to generate the return value.</block>
          </para>
        </remarks>
        <example>
          <para>The following example demonstrates using the
   <see langword="Next" /> method. The output generated by this example 
      will
      vary.</para>
          <code lang="C#">using System;
class RandomTest {
    public static void Main() {
        Random rand1 = new Random();
        for (int i = 0; i&lt;10;i++)
        Console.WriteLine("The random number is {0}",rand1.Next());
        
    }
}
   </code>
          <para>The output is</para>
          <c>
            <para> The random number is
         1544196111</para>
            <para> The random number is
         181749919</para>
            <para> The random number is
         1045210087</para>
            <para> The random number is
         1073826097</para>
            <para> The random number is
         1533078806</para>
            <para> The random number is
         1083151645</para>
            <para> The random number is
         569083504</para>
            <para> The random number is
         1711370568</para>
            <para> The random number is
         578178313</para>
            <para> The random number is
         409444742</para>
          </c>
        </example>
      </Docs>
      <Excluded>0</Excluded>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="Next">
      <MemberSignature Language="ILASM" Value=".method public hidebysig virtual int32 Next(int32 maxValue)" />
      <MemberSignature Language="C#" Value="public virtual int Next (int maxValue);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="maxValue" Type="System.Int32" />
      </Parameters>
      <Docs>
        <param name="maxValue">The upper bound of the random number to be generated. <paramref name="maxValue" /> is required to be greater than or equal to zero.</param>
        <summary>
          <para>Returns a psuedo-random positive number less than the specified
      maximum.</para>
        </summary>
        <returns>
          <para>A <see cref="T:System.Int32" /> set to a psuedo-random value greater than or equal to zero
   and less than <paramref name="maxValue" />. If <paramref name="maxValue" /> is zero, returns zero.</para>
        </returns>
        <remarks>
          <para>
            <block subset="none" type="behaviors">As described
      above.</block>
          </para>
          <para>
            <block subset="none" type="overrides">Override this method to customize
      the algorithm used to generate the return value.</block>
          </para>
          <para>
            <block subset="none" type="usage">Use this method to generate a psuedo-random number
      less than the specified maximum value.</block>
          </para>
        </remarks>
        <exception cref="T:System.ArgumentOutOfRangeException">
          <paramref name="maxValue" /> is less than zero.</exception>
      </Docs>
      <Excluded>0</Excluded>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="Next">
      <MemberSignature Language="ILASM" Value=".method public hidebysig virtual int32 Next(int32 minValue, int32 maxValue)" />
      <MemberSignature Language="C#" Value="public virtual int Next (int minValue, int maxValue);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="minValue" Type="System.Int32" />
        <Parameter Name="maxValue" Type="System.Int32" />
      </Parameters>
      <Docs>
        <param name="minValue">The lower bound of the random number returned.</param>
        <param name="maxValue">The upper bound of the random number returned.</param>
        <summary>
          <para>Returns a psuedo-random number within a specified range.</para>
        </summary>
        <returns>
          <para>A psuedo-random number greater than or equal to <paramref name="minValue" /> and
   less than <paramref name="maxValue" />. If <paramref name="minValue" /> and
<paramref name="maxValue " />are equal, this value 
   is returned.</para>
        </returns>
        <remarks>
          <para>
            <block subset="none" type="behaviors">As described above.</block>
          </para>
          <para>
            <block subset="none" type="overrides">Override this
      method to customize the algorithm used to generate the return
      value.</block>
          </para>
          <para>
            <block subset="none" type="usage">Use this method to generate
      psuedo-random numbers in a specified range.</block>
          </para>
        </remarks>
        <exception cref="T:System.ArgumentOutOfRangeException">
          <paramref name="minValue" /> is greater than <paramref name="maxValue" />.</exception>
      </Docs>
      <Excluded>0</Excluded>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="NextBytes">
      <MemberSignature Language="ILASM" Value=".method public hidebysig virtual void NextBytes(class System.Byte[] buffer)" />
      <MemberSignature Language="C#" Value="public virtual void NextBytes (byte[] buffer);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="buffer" Type="System.Byte[]" />
      </Parameters>
      <Docs>
        <param name="buffer">An array of bytes to be populated with random numbers.</param>
        <summary>
          <para>Populates the elements of a specified array of bytes with random numbers.</para>
        </summary>
        <remarks>
          <para>
            <block subset="none" type="behaviors">Each element of the array of bytes is set to a random number greater than or
 equal to zero, and less than or equal to <see cref="F:System.Byte.MaxValue" />.</block>
          </para>
          <para>
            <block subset="none" type="overrides">Override this method to customize
 the algorithm used to generate the return value.</block>
          </para>
          <para>
            <block subset="none" type="usage">Use the
 <see langword=" NextByte" /> method to populate a <see cref="T:System.Byte" />
 array with random numbers.</block>
          </para>
        </remarks>
        <exception cref="T:System.ArgumentNullException">
          <paramref name="buffer" /> is a <see langword="null" /> reference.</exception>
      </Docs>
      <Excluded>0</Excluded>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="NextDouble">
      <MemberSignature Language="ILASM" Value=".method public hidebysig virtual float64 NextDouble()" />
      <MemberSignature Language="C#" Value="public virtual double NextDouble ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Double</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>
          <para>Returns a random number between 0.0 and 1.0.</para>
        </summary>
        <returns>
          <para>A <see cref="T:System.Double" /> greater than or equal to 0.0, and less than 1.0.</para>
        </returns>
        <remarks>
          <para>
            <block subset="none" type="behaviors">As described 
      above.</block>
          </para>
          <para>
            <block subset="none" type="usage">Use this method to generate a
      psuedo-random number greater than or equal to zero, and less than
      one.</block>
          </para>
        </remarks>
      </Docs>
      <Excluded>1</Excluded>
      <ExcludedLibrary>ExtendedNumerics</ExcludedLibrary>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
    <Member MemberName="Sample">
      <MemberSignature Language="C#" Value="protected virtual double Sample ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Double</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
      <AssemblyInfo>
        <AssemblyVersion>1.0.5000.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
    </Member>
  </Members>
  <TypeExcluded>0</TypeExcluded>
  <Attributes>
    <Attribute>
      <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
    </Attribute>
  </Attributes>
</Type>
