mirror of https://github.com/oliverbooth/X10D
Use Lerp for Random.NextDouble
This commit is contained in:
parent
f961530962
commit
1598ffef99
|
@ -1,5 +1,6 @@
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using X10D.Math;
|
||||||
|
|
||||||
namespace X10D;
|
namespace X10D;
|
||||||
|
|
||||||
|
@ -108,7 +109,7 @@ public static class RandomExtensions
|
||||||
throw new ArgumentOutOfRangeException(ExceptionMessages.MaxValueGreaterThanEqualToMinValue);
|
throw new ArgumentOutOfRangeException(ExceptionMessages.MaxValueGreaterThanEqualToMinValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (random.NextDouble() * (maxValue - minValue)) + minValue;
|
return MathUtility.Lerp(minValue, maxValue, random.NextDouble());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue