diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmath/llrand.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linden/indra/llmath/llrand.cpp b/linden/indra/llmath/llrand.cpp index f62bd71..e6c4cc5 100644 --- a/linden/indra/llmath/llrand.cpp +++ b/linden/indra/llmath/llrand.cpp | |||
@@ -106,7 +106,7 @@ inline F64 ll_internal_random_double() | |||
106 | // occasionally give an obviously incorrect random number -- like | 106 | // occasionally give an obviously incorrect random number -- like |
107 | // 5^15 or something. Sooooo, clamp it as described above. | 107 | // 5^15 or something. Sooooo, clamp it as described above. |
108 | F64 rv = gRandomGenerator(); | 108 | F64 rv = gRandomGenerator(); |
109 | if(!((rv >= 0.0) && (rv < 1.0))) return 0.0; | 109 | if(!((rv >= 0.0) && (rv < 1.0))) return fmod(rv, 1.0); |
110 | return rv; | 110 | return rv; |
111 | } | 111 | } |
112 | 112 | ||
@@ -114,7 +114,7 @@ inline F32 ll_internal_random_float() | |||
114 | { | 114 | { |
115 | // The clamping rules are described above. | 115 | // The clamping rules are described above. |
116 | F32 rv = (F32)gRandomGenerator(); | 116 | F32 rv = (F32)gRandomGenerator(); |
117 | if(!((rv >= 0.0f) && (rv < 1.0f))) return 0.0f; | 117 | if(!((rv >= 0.0f) && (rv < 1.0f))) return fmod(rv, 1.f); |
118 | return rv; | 118 | return rv; |
119 | } | 119 | } |
120 | #endif | 120 | #endif |