Kotz's editorconfig styles slightly modified. Target typed new usage. Brackets in expressions used for clarity.

This commit is contained in:
Kwoth
2021-12-26 02:52:09 +01:00
parent 68741ec484
commit d18f9429c6
172 changed files with 921 additions and 494 deletions

View File

@@ -36,7 +36,7 @@ public class NadekoRandom : Random
var bytes = new byte[sizeof(int)];
_rng.GetBytes(bytes);
var sign = Math.Sign(BitConverter.ToInt32(bytes, 0));
return sign * BitConverter.ToInt32(bytes, 0) % (maxValue - minValue) + minValue;
return (sign * BitConverter.ToInt32(bytes, 0) % (maxValue - minValue)) + minValue;
}
public long NextLong(long minValue, long maxValue)
@@ -48,7 +48,7 @@ public class NadekoRandom : Random
var bytes = new byte[sizeof(long)];
_rng.GetBytes(bytes);
var sign = Math.Sign(BitConverter.ToInt64(bytes, 0));
return sign * BitConverter.ToInt64(bytes, 0) % (maxValue - minValue) + minValue;
return (sign * BitConverter.ToInt64(bytes, 0) % (maxValue - minValue)) + minValue;
}
public override void NextBytes(byte[] buffer)
@@ -60,7 +60,7 @@ public class NadekoRandom : Random
{
var bytes = new byte[sizeof(double)];
_rng.GetBytes(bytes);
return Math.Abs(BitConverter.ToDouble(bytes, 0) / double.MaxValue + 1);
return Math.Abs((BitConverter.ToDouble(bytes, 0) / double.MaxValue) + 1);
}
public override double NextDouble()