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