From 038e32a2345b064cb793a8ece77f1eda1bd824b0 Mon Sep 17 00:00:00 2001 From: Keuin Date: Tue, 3 May 2022 15:55:39 +0800 Subject: Bugfix: range01_scalar does not obey to its contract. --- vec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vec.h') diff --git a/vec.h b/vec.h index 13e87b5..99f5f46 100644 --- a/vec.h +++ b/vec.h @@ -215,7 +215,7 @@ public: // Get a random real number in range [0, 1]. inline T range01_scalar() { - return uni(mt); + return std::abs(uni(mt)); }; // Get a unit vector with random direction. -- cgit v1.2.3