Commit ac72f5c4 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Use ldexp instead of pow for more accuracy.

Original patch by net147@gmail.com: https://chromiumcodereview.appspot.com/10026011/

BUG=
TEST=cctest/test-conversions/Octal

Review URL: https://chromiumcodereview.appspot.com/10103030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11356 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b2024c53
......@@ -228,9 +228,7 @@ double InternalStringToIntDouble(UnicodeCache* unicode_cache,
}
ASSERT(number != 0);
// The double could be constructed faster from number (mantissa), exponent
// and sign. Assuming it's a rare case more simple code is used.
return static_cast<double>(negative ? -number : number) * pow(2.0, exponent);
return ldexp(static_cast<double>(negative ? -number : number), exponent);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment