remove Fix64 dependency on System.Random

pull/51/head
cosmonaut 2023-10-13 13:38:26 -07:00
parent e616b0fa62
commit 18d92aeec8
1 changed files with 0 additions and 24 deletions

View File

@ -72,30 +72,6 @@ namespace MoonWorks.Math.Fixed
return new Fix64(number.RawValue & 0x00000000FFFFFFFF); return new Fix64(number.RawValue & 0x00000000FFFFFFFF);
} }
public static Fix64 Random(System.Random random, int max)
{
return new Fix64(random.NextInt64(new Fix64(max).RawValue));
}
public static Fix64 Random(System.Random random, Fix64 max)
{
return new Fix64(random.NextInt64(max.RawValue));
}
public static Fix64 Random(System.Random random, Fix64 min, Fix64 max)
{
return new Fix64(random.NextInt64(min.RawValue, max.RawValue));
}
// Max should be between 0.0 and 1.0.
public static Fix64 RandomFraction(System.Random random, Fix64 max)
{
long fractionalPart = (max.RawValue & 0x00000000FFFFFFFF);
long fractional = random.NextInt64(fractionalPart);
return new Fix64(fractional);
}
/// <summary> /// <summary>
/// Returns an int indicating the sign of a Fix64 number. /// Returns an int indicating the sign of a Fix64 number.
/// </summary> /// </summary>