simplify float parsing

master
Daniel Kolesa 2016-08-17 17:10:55 +01:00
parent 5aa4b871cb
commit 6a9be3885f
1 changed files with 2 additions and 6 deletions

View File

@ -141,17 +141,13 @@ static inline bool parse_gen_float(
if (!wn && !fn) {
return false;
}
if (Hex) {
fn *= -4;
} else {
fn = -fn;
}
fn = -fn;
p_set_end(input, end); /* we have a valid number until here */
if (p_read_exp<Hex>(input, fn)) {
p_set_end(input, end);
}
if (Hex) {
ret = CsFloat(ldexp(r, fn));
ret = CsFloat(ldexp(r, fn * 4));
} else {
ret = CsFloat(r * pow(10, fn));
}