aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 5f94b5cc..1764773b 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -397,6 +397,9 @@ function _IntToHex(x) {
function IEEEUnHex(stringy) {
stringy = stringy.substr(2); // leading '0x';
+ if (stringy.replace(/0/g, '') === '') return 0;
+ while (stringy.length < 16) stringy = '0' + stringy;
+ assert(stringy.length === 16, 'Can only undex 16-digit double numbers, nothing platform-specific');
var top = eval('0x' + stringy[0]);
var neg = !!(top & 8); // sign
if (neg) {