mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 10:18:27 -04:00
Kotz's editorconfig styles slightly modified. Target typed new usage. Brackets in expressions used for clarity.
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user