Skip to content

Commit 563b450

Browse files
committed
Edit documentation; nonsubstantive code edits
1 parent 2cb78a9 commit 563b450

File tree

8 files changed

+423
-437
lines changed

8 files changed

+423
-437
lines changed

Numbers/PeterO/Numbers/BitShiftAccumulator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ private FastInteger CalcKnownBitLength() {
323323
}
324324

325325
private void ShiftBigToBits(int bits) {
326-
// Shifts a number until it reaches the given number of bits,
326+
// Shifts a number until it reaches the specified number of bits,
327327
// gathering information on whether the last bit discarded is set and
328328
// whether the discarded bits to the right of that bit are set. Assumes
329329
// that the big integer being shifted is positive.

Numbers/PeterO/Numbers/DigitShiftAccumulator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ private void ShiftRightLong(long shiftedLong, int digits) {
714714
}
715715

716716
private void ShiftToDigitsBig(int digits, bool truncate) {
717-
// Shifts a number until it reaches the given number of digits,
717+
// Shifts a number until it reaches the specified number of digits,
718718
// gathering information on whether the last digit discarded is set
719719
// and whether the discarded digits to the right of that digit are set.
720720
// Assumes that the big integer being shifted is positive.

Numbers/PeterO/Numbers/NumberUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ public static EInteger IntegerDigitLengthUpperBound<THelper>(
843843
IRadixMathHelper<THelper> helper,
844844
THelper val) {
845845
// Gets an upper bound on the number of digits in the integer
846-
// part of the given number 'val'.
846+
// part of the specified number 'val'.
847847
int flags = helper.GetFlags(val);
848848
if ((flags & BigNumberFlags.FlagSpecial) != 0) {
849849
// Infinity and NaN are not supported

Numbers/PeterO/Numbers/RadixMath.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6504,7 +6504,7 @@ public T SignalOverflow(EContext ctx, bool neg) {
65046504
(roundingOnOverflow == ERounding.Ceiling && neg) ||
65056505
(roundingOnOverflow == ERounding.Floor && !neg))) {
65066506
// Set to the highest possible value for
6507-
// the given precision
6507+
// the specified precision
65086508
EInteger overflowMant = EInteger.Zero;
65096509
FastInteger fastPrecision = FastInteger.FromBig(ctx.Precision);
65106510
overflowMant = this.TryMultiplyByRadixPower(

Numbers/docs.xml

Lines changed: 295 additions & 309 deletions
Large diffs are not rendered by default.

Test/RandomGenerator.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public RandomGenerator(IRandomGen valueIrg) {
3030
this.valueIrg = valueIrg;
3131
}
3232

33-
/// <summary>Returns either true or false, depending on the given
33+
/// <summary>Returns either true or false, depending on the specified
3434
/// probability.</summary>
3535
/// <param name='p'>A probability from 0 through 1. 0 means always
3636
/// false, and 1 means always true.</param>
@@ -49,9 +49,9 @@ public bool Bernoulli() {
4949
return this.UniformInt(2) == 0;
5050
}
5151

52-
/// <summary>Conceptually, generates either 1 or 0 the given number of
53-
/// times, where either number is equally likely, and counts the number
54-
/// of 1's generated.</summary>
52+
/// <summary>Conceptually, generates either 1 or 0 the specified number
53+
/// of times, where either number is equally likely, and counts the
54+
/// number of 1's generated.</summary>
5555
/// <param name='trials'>The number of times to generate a random
5656
/// number, conceptually.</param>
5757
/// <returns>A 32-bit signed integer.</returns>
@@ -68,9 +68,9 @@ public int GetBytes(byte[] bytes, int offset, int count) {
6868
return this.valueIrg.GetBytes(bytes, offset, count);
6969
}
7070

71-
/// <summary>Conceptually, generates either 1 or 0 the given number of
72-
/// times, where a 1 is generated at the given probability, and counts
73-
/// the number of 1's generated.</summary>
71+
/// <summary>Conceptually, generates either 1 or 0 the specified number
72+
/// of times, where a 1 is generated at the specified probability, and
73+
/// counts the number of 1's generated.</summary>
7474
/// <param name='trials'>The number of times to generate a random
7575
/// number, conceptually.</param>
7676
/// <param name='p'>The probability for each trial to succeed, from 0
@@ -173,7 +173,7 @@ public int Geometric() {
173173

174174
/// <summary>Conceptually, generates either 1 or 0 until a 1 is
175175
/// generated, and counts the number of 0's generated. A 1 is generated
176-
/// at the given probability.</summary>
176+
/// at the specified probability.</summary>
177177
/// <param name='p'>A 64-bit floating-point number.</param>
178178
/// <returns>The number of failures until a success happens.</returns>
179179
public int Geometric(double p) {
@@ -221,17 +221,17 @@ public int Hypergeometric(int trials, int ones, int count) {
221221
}
222222

223223
/// <summary>Generates a logarithmic normally-distributed number with
224-
/// the given mean and standard deviation.</summary>
224+
/// the specified mean and standard deviation.</summary>
225225
/// <param name='mean'>The desired mean.</param>
226226
/// <param name='sd'>Standard deviation.</param>
227227
/// <returns>A 64-bit floating-point number.</returns>
228228
public double LogNormal(double mean, double sd) {
229229
return Math.Exp(this.Normal(mean, sd));
230230
}
231231

232-
/// <summary>Conceptually, generates either 1 or 0 until the given
232+
/// <summary>Conceptually, generates either 1 or 0 until the specified
233233
/// number of 1's are generated, and counts the number of 0's
234-
/// generated. A 1 is generated at the given probability.</summary>
234+
/// generated. A 1 is generated at the specified probability.</summary>
235235
/// <param name='trials'>The number of 1's to generate before the
236236
/// process stops.</param>
237237
/// <param name='p'>The probability for each trial to succeed, from 0
@@ -288,10 +288,10 @@ public int NegativeBinomial(int trials, double p) {
288288
}
289289
}
290290

291-
/// <summary>Conceptually, generates either 1 or 0 the given number of
292-
/// times until the given number of 1's are generated, and counts the
293-
/// number of 0's generated. Either number has an equal probability of
294-
/// being generated.</summary>
291+
/// <summary>Conceptually, generates either 1 or 0 the specified number
292+
/// of times until the specified number of 1's are generated, and
293+
/// counts the number of 0's generated. Either number has an equal
294+
/// probability of being generated.</summary>
295295
/// <param name='trials'>The number of 1's to generate before the
296296
/// process stops.</param>
297297
/// <returns>The number of 0's generated. Returns Int32.MaxValue if "p"
@@ -325,7 +325,7 @@ public double Normal() {
325325
return s * Math.Cos(t);
326326
}
327327

328-
/// <summary>Generates a normally-distributed number with the given
328+
/// <summary>Generates a normally-distributed number with the specified
329329
/// mean and standard deviation.</summary>
330330
/// <param name='mean'>The desired mean.</param>
331331
/// <param name='sd'>Standard deviation.</param>
@@ -335,8 +335,8 @@ public double Normal(double mean, double sd) {
335335
}
336336

337337
/// <summary>Generates a random integer such that the average of random
338-
/// numbers approaches the given mean number when this method is called
339-
/// repeatedly with the same mean.</summary>
338+
/// numbers approaches the specified mean number when this method is
339+
/// called repeatedly with the same mean.</summary>
340340
/// <param name='mean'>The expected mean of the random numbers.</param>
341341
/// <returns>A 32-bit signed integer.</returns>
342342
public int Poisson(double mean) {
@@ -369,7 +369,7 @@ public double Uniform(double min, double max) {
369369
}
370370

371371
/// <summary>Returns a uniformly-distributed 64-bit floating-point
372-
/// number from 0 and up, but less than the given number.</summary>
372+
/// number from 0 and up, but less than the specified number.</summary>
373373
/// <param name='max'>Number that the randomly-generated number will be
374374
/// less than.</param>
375375
/// <returns>A 64-bit floating-point number.</returns>
@@ -460,7 +460,7 @@ public long UniformLong(long minInclusive, long maxExclusive) {
460460
}
461461

462462
/// <summary>Generates a random 32-bit signed integer 0 or greater and
463-
/// less than the given number.</summary>
463+
/// less than the specified number.</summary>
464464
/// <param name='maxExclusive'>One plus the largest possible value of
465465
/// the random number.</param>
466466
/// <returns>A 32-bit signed integer.</returns>
@@ -533,7 +533,7 @@ public int GetInt32(int maxExclusive) {
533533
}
534534

535535
/// <summary>Generates a random 32-bit signed integer 0 or greater and
536-
/// less than the given number.</summary>
536+
/// less than the specified number.</summary>
537537
/// <param name='maxExclusive'>One plus the largest possible value of
538538
/// the random number.</param>
539539
/// <returns>A 64-bit signed integer.</returns>

0 commit comments

Comments
 (0)