Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
43529908
Commit
43529908
authored
Jul 23, 2016
by
Davis King
Browse files
Fixed potential division by zero.
parent
938e9771
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
dlib/statistics/running_gradient.h
dlib/statistics/running_gradient.h
+9
-0
No files found.
dlib/statistics/running_gradient.h
View file @
43529908
...
...
@@ -154,6 +154,15 @@ namespace dlib
static
double
normal_cfd
(
double
value
,
double
mean
,
double
stddev
)
{
if
(
stddev
==
0
)
{
if
(
value
<
mean
)
return
0
;
else
if
(
value
>
mean
)
return
1
;
else
return
0.5
;
}
value
=
(
value
-
mean
)
/
stddev
;
return
0.5
*
erfc
(
-
value
/
std
::
sqrt
(
2.0
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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