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
tianlh
LightGBM-DCU
Commits
44c201c4
Commit
44c201c4
authored
Oct 20, 2016
by
Guolin Ke
Committed by
GitHub
Oct 20, 2016
Browse files
bug fixed in atof
parent
7d4b6d44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
include/LightGBM/utils/common.h
include/LightGBM/utils/common.h
+12
-10
No files found.
include/LightGBM/utils/common.h
View file @
44c201c4
...
@@ -148,17 +148,19 @@ inline static const char* Atof(const char* p, double* out) {
...
@@ -148,17 +148,19 @@ inline static const char* Atof(const char* p, double* out) {
&&
*
(
p
+
cnt
)
!=
':'
)
{
&&
*
(
p
+
cnt
)
!=
':'
)
{
++
cnt
;
++
cnt
;
}
}
std
::
string
tmp_str
(
p
,
cnt
);
if
(
cnt
>
0
){
std
::
transform
(
tmp_str
.
begin
(),
tmp_str
.
end
(),
tmp_str
.
begin
(),
::
tolower
);
std
::
string
tmp_str
(
p
,
cnt
);
if
(
tmp_str
==
std
::
string
(
"na"
)
||
tmp_str
==
std
::
string
(
"nan"
))
{
std
::
transform
(
tmp_str
.
begin
(),
tmp_str
.
end
(),
tmp_str
.
begin
(),
::
tolower
);
*
out
=
0
;
if
(
tmp_str
==
std
::
string
(
"na"
)
||
tmp_str
==
std
::
string
(
"nan"
))
{
}
else
if
(
tmp_str
==
std
::
string
(
"inf"
)
||
tmp_str
==
std
::
string
(
"infinity"
))
{
*
out
=
0
;
*
out
=
sign
*
1e308
;
}
else
if
(
tmp_str
==
std
::
string
(
"inf"
)
||
tmp_str
==
std
::
string
(
"infinity"
))
{
}
*
out
=
sign
*
1e308
;
else
{
}
Log
::
Stderr
(
"Unknow token %s in data file"
,
tmp_str
.
c_str
());
else
{
Log
::
Stderr
(
"Unknow token %s in data file"
,
tmp_str
.
c_str
());
}
p
+=
cnt
;
}
}
p
+=
cnt
;
}
}
while
(
*
p
==
' '
)
{
while
(
*
p
==
' '
)
{
...
...
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