aboutsummaryrefslogtreecommitdiff
path: root/sp/src/mathlib/halton.cpp
diff options
context:
space:
mode:
authorNarendra Umate <[email protected]>2013-12-02 23:36:05 -0800
committerNarendra Umate <[email protected]>2013-12-02 23:36:05 -0800
commit8737f191f3b59f001a77bf6c08091109211c1c9f (patch)
treedbbf05c004d9b026f2c1f23f06600fe0add82c36 /sp/src/mathlib/halton.cpp
parentUpdate .gitignore. (diff)
parentMake .xcconfigs text files too. (diff)
downloadsource-sdk-2013-8737f191f3b59f001a77bf6c08091109211c1c9f.tar.xz
source-sdk-2013-8737f191f3b59f001a77bf6c08091109211c1c9f.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'sp/src/mathlib/halton.cpp')
-rw-r--r--sp/src/mathlib/halton.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/sp/src/mathlib/halton.cpp b/sp/src/mathlib/halton.cpp
index d0c56325..f9daae71 100644
--- a/sp/src/mathlib/halton.cpp
+++ b/sp/src/mathlib/halton.cpp
@@ -1,30 +1,30 @@
-//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=====================================================================================//
-
-#include <halton.h>
-
-HaltonSequenceGenerator_t::HaltonSequenceGenerator_t(int b)
-{
- base=b;
- fbase=(float) b;
- seed=1;
-
-}
-
-float HaltonSequenceGenerator_t::GetElement(int elem)
-{
- int tmpseed=seed;
- float ret=0.0;
- float base_inv=1.0/fbase;
- while(tmpseed)
- {
- int dig=tmpseed % base;
- ret+=((float) dig)*base_inv;
- base_inv/=fbase;
- tmpseed/=base;
- }
- return ret;
-}
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=====================================================================================//
+
+#include <halton.h>
+
+HaltonSequenceGenerator_t::HaltonSequenceGenerator_t(int b)
+{
+ base=b;
+ fbase=(float) b;
+ seed=1;
+
+}
+
+float HaltonSequenceGenerator_t::GetElement(int elem)
+{
+ int tmpseed=seed;
+ float ret=0.0;
+ float base_inv=1.0/fbase;
+ while(tmpseed)
+ {
+ int dig=tmpseed % base;
+ ret+=((float) dig)*base_inv;
+ base_inv/=fbase;
+ tmpseed/=base;
+ }
+ return ret;
+}