From ba662d7c3e87ec910d8091849c3fdf1a56041626 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Tue, 14 Jun 2022 18:25:37 -0700 Subject: [PATCH] add Fix64 random range --- src/Math/Fixed/Fix64.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Math/Fixed/Fix64.cs b/src/Math/Fixed/Fix64.cs index 119d5832..050efa8a 100644 --- a/src/Math/Fixed/Fix64.cs +++ b/src/Math/Fixed/Fix64.cs @@ -69,6 +69,11 @@ namespace MoonWorks.Math.Fixed return new Fix64(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) {