forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVBMath.xml
222 lines (172 loc) · 11.1 KB
/
VBMath.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<Type Name="VBMath" FullName="Microsoft.VisualBasic.VBMath">
<TypeSignature Language="C#" Value="public sealed class VBMath" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed VBMath extends System.Object" />
<TypeSignature Language="DocId" Value="T:Microsoft.VisualBasic.VBMath" />
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>Microsoft.VisualBasic.CompilerServices.StandardModule</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>The <see langword="VbMath" /> module contains procedures used to perform mathematical operations.</summary>
<remarks>
<format type="text/markdown"><]
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName="Randomize">
<MemberSignature Language="C#" Value="public static void Randomize ();" />
<MemberSignature Language="ILAsm" Value=".method public static void Randomize() cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.VBMath.Randomize" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Initializes the random-number generator.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This overload of the `Randomize` method does not take a seed value. Instead, the value returned by the system timer is used as the new seed value.
If `Randomize` is not used, the `Rnd` function (with no arguments) uses the same number as a seed the first time it is called, and thereafter uses the last-generated number as a seed value.
> [!NOTE]
> To repeat sequences of random numbers, call `Rnd` with a negative argument immediately before using `Randomize` with a numeric argument.
> [!IMPORTANT]
> Because the `Random` statement and the `Rnd` function start with a seed value and generate numbers that fall within a finite range, the results may be predictable by someone who knows the algorithm used to generate them. Consequently, the `Random` statement and the `Rnd` function should not be used to generate random numbers for use in cryptography. For more information, see <xref:System.Security.Cryptography.RandomNumberGenerator>.
## Examples
This example uses the `Randomize` statement to initialize the random-number generator. Because the number argument has been omitted, `Randomize` uses the return value from the `Timer` function as the new seed value.
[!code-vb[VbVbalrMath#21](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMath/VB/Class1.vb#21)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Randomize">
<MemberSignature Language="C#" Value="public static void Randomize (double Number);" />
<MemberSignature Language="ILAsm" Value=".method public static void Randomize(float64 Number) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.VBMath.Randomize(System.Double)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="Number" Type="System.Double" />
</Parameters>
<Docs>
<param name="Number">Optional. An <see langword="Object" /> or any valid numeric expression.</param>
<summary>Initializes the random-number generator.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
`Randomize` uses `Number` to initialize the `Rnd` function's random-number generator, giving it a new seed value. If you omit `Number`, the value returned by the system timer is used as the new seed value.
If `Randomize` is not used, the `Rnd` function (with no arguments) uses the same number as a seed the first time it is called, and thereafter uses the last-generated number as a seed value.
> [!NOTE]
> To repeat sequences of random numbers, call `Rnd` with a negative argument immediately before using `Randomize` with a numeric argument. Using `Randomize` with the same value for `Number` does not repeat the previous sequence.
> [!IMPORTANT]
> Because the `Random` statement and the `Rnd` function start with a seed value and generate numbers that fall within a finite range, the results may be predictable by someone who knows the algorithm used to generate them. Consequently, the `Random` statement and the `Rnd` function should not be used to generate random numbers for use in cryptography. For more information, see <xref:System.Security.Cryptography.RandomNumberGenerator>.
## Examples
This example uses the `Randomize` statement to initialize the random-number generator. Because the number argument has been omitted, `Randomize` uses the return value from the `Timer` function as the new seed value.
[!code-vb[VbVbalrMath#21](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMath/VB/Class1.vb#21)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Rnd">
<MemberSignature Language="C#" Value="public static float Rnd ();" />
<MemberSignature Language="ILAsm" Value=".method public static float32 Rnd() cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.VBMath.Rnd" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Single</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns a random number of type <see langword="Single" />.</summary>
<returns>The next random number in the sequence.</returns>
<remarks>
<format type="text/markdown"><]
Here, `upperbound` is the highest number in the range, and `lowerbound` is the lowest number in the range.
> [!NOTE]
> To repeat sequences of random numbers, call `Rnd` with a negative argument immediately before using `Randomize` with a numeric argument.
> [!IMPORTANT]
> Because the `Random` statement and the `Rnd` function start with a seed value and generate numbers that fall within a finite range, the results may be predictable by someone who knows the algorithm used to generate them. Consequently, the `Random` statement and the `Rnd` function should not be used to generate random numbers for use in cryptography.
## Examples
This example uses the `Rnd` function to generate a random integer value in the range from 1 to 6.
[!code-vb[VbVbalrMath#21](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMath/VB/Class1.vb#21)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Rnd">
<MemberSignature Language="C#" Value="public static float Rnd (float Number);" />
<MemberSignature Language="ILAsm" Value=".method public static float32 Rnd(float32 Number) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.VisualBasic.VBMath.Rnd(System.Single)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.VisualBasic</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Single</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="Number" Type="System.Single" />
</Parameters>
<Docs>
<param name="Number">Optional. A <see langword="Single" /> value or any valid <see langword="Single" /> expression.</param>
<summary>Returns a random number of type <see langword="Single" />.</summary>
<returns>If number is less than zero, Rnd generates the same number every time, using <paramref name="Number" /> as the seed. If number is greater than zero, Rnd generates the next random number in the sequence. If number is equal to zero, Rnd generates the most recently generated number. If number is not supplied, Rnd generates the next random number in the sequence.</returns>
<remarks>
<format type="text/markdown"><]
Here, `upperbound` is the highest number in the range, and `lowerbound` is the lowest number in the range.
> [!NOTE]
> To repeat sequences of random numbers, call `Rnd` with a negative argument immediately before using `Randomize` with a numeric argument. Using `Randomize` with the same value for `Number` does not repeat the previous sequence.
> [!IMPORTANT]
> Because the `Random` statement and the `Rnd` function start with a seed value and generate numbers that fall within a finite range, the results may be predictable by someone who knows the algorithm used to generate them. Consequently, the `Random` statement and the `Rnd` function should not be used to generate random numbers for use in cryptography.
## Examples
This example uses the `Rnd` function to generate a random integer value in the range from 1 to 6.
[!code-vb[VbVbalrMath#21](~/samples/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMath/VB/Class1.vb#21)]
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>