1
0
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:
Oliver Booth 2022-04-22 09:15:11 +01:00
parent f961530962
commit 1598ffef99
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634

View File

@ -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>