Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CLHEP
CLHEP
Commits
10cdd9f0
Commit
10cdd9f0
authored
May 27, 2015
by
Lynn Garren
Browse files
use std::abs
parent
d0a90083
Changes
2
Hide whitespace changes
Inline
Side-by-side
Random/Random/RandGaussZiggurat.h
View file @
10cdd9f0
...
...
@@ -103,7 +103,7 @@ protected:
//static unsigned long iz, kn[128], ke[256];
//static float wn[128],fn[128], we[256],fe[256];
//
//#define RNOR (hz=SHR3, iz=hz&127, (fabs(hz)<kn[iz])? hz*wn[iz] : nfix())
//#define RNOR (hz=SHR3, iz=hz&127, (
std::
fabs(hz)<kn[iz])? hz*wn[iz] : nfix())
//#define REXP (jz=SHR3, iz=jz&255, ( jz <ke[iz])? jz*we[iz] : efix())
static
CLHEP_THREAD_LOCAL
unsigned
long
kn
[
128
],
ke
[
256
];
...
...
@@ -117,7 +117,7 @@ protected:
if
(
!
ziggurat_is_init
)
ziggurat_init
();
long
hz
=
(
signed
)
ziggurat_SHR3
(
anEngine
);
unsigned
long
iz
=
hz
&
127
;
return
((
unsigned
long
)
abs
(
hz
)
<
kn
[
iz
])
?
hz
*
wn
[
iz
]
:
ziggurat_nfix
(
hz
,
anEngine
);
return
((
unsigned
long
)
std
::
abs
(
hz
)
<
kn
[
iz
])
?
hz
*
wn
[
iz
]
:
ziggurat_nfix
(
hz
,
anEngine
);
};
static
float
ziggurat_nfix
(
long
hz
,
HepRandomEngine
*
anEngine
);
...
...
Random/src/RandGaussZiggurat.cc
View file @
10cdd9f0
...
...
@@ -95,7 +95,7 @@ float RandGaussZiggurat::ziggurat_nfix(long hz,HepRandomEngine* anEngine)
/* initiate, try to exit for(;;) for loop*/
hz
=
(
signed
)
ziggurat_SHR3
(
anEngine
);
iz
=
hz
&
127
;
if
((
unsigned
long
)
abs
(
hz
)
<
kn
[
iz
])
return
(
hz
*
wn
[
iz
]);
if
((
unsigned
long
)
std
::
abs
(
hz
)
<
kn
[
iz
])
return
(
hz
*
wn
[
iz
]);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment