summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-05-03 15:55:39 +0800
committerKeuin <[email protected]>2022-05-03 15:55:39 +0800
commit038e32a2345b064cb793a8ece77f1eda1bd824b0 (patch)
treea5565dce9c41db6baaba32e945662071bd994084
parent75e13a6039cab6c8bbde5bf6544efcdbfff0f30e (diff)
Bugfix: range01_scalar does not obey to its contract.
-rw-r--r--vec.h2
1 files changed, 1 insertions, 1 deletions
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.