mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
BasicParser::parseNumber() out of range fix
This commit is contained in:
parent
941d3bcf8e
commit
14aa5df586
1 changed files with 11 additions and 9 deletions
|
|
@ -435,19 +435,21 @@ dv::value BasicParser<CharT>::parseNumber(int sign) {
|
||||||
static_cast<int64_t>(std::log10(afterdot) + 1)
|
static_cast<int64_t>(std::log10(afterdot) + 1)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
c = source[pos];
|
|
||||||
|
|
||||||
double dvalue = (value + (afterdot / (double)expo));
|
double dvalue = (value + (afterdot / (double)expo));
|
||||||
if (c == 'e' || c == 'E') {
|
if (hasNext()){
|
||||||
pos++;
|
c = source[pos];
|
||||||
int s = 1;
|
if (c == 'e' || c == 'E') {
|
||||||
if (peek() == '-') {
|
|
||||||
s = -1;
|
|
||||||
pos++;
|
|
||||||
} else if (peek() == '+') {
|
|
||||||
pos++;
|
pos++;
|
||||||
|
int s = 1;
|
||||||
|
if (peek() == '-') {
|
||||||
|
s = -1;
|
||||||
|
pos++;
|
||||||
|
} else if (peek() == '+') {
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
return sign * dvalue * power(10.0, s * parseSimpleInt(10));
|
||||||
}
|
}
|
||||||
return sign * dvalue * power(10.0, s * parseSimpleInt(10));
|
|
||||||
}
|
}
|
||||||
return sign * dvalue;
|
return sign * dvalue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue