Fix handling of 1.797693134862315808e+308 floating point value.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan 2015-10-28 22:05:13 +03:00
parent 04ca231fa4
commit 2bfd754ef3
3 changed files with 5 additions and 3 deletions

View File

@ -619,7 +619,7 @@ typedef double ecma_number_t;
/**
* Maximum number of significant digits that ecma-number can store
*/
#define ECMA_NUMBER_MAX_DIGITS (18)
#define ECMA_NUMBER_MAX_DIGITS (19)
/**
* Width of sign field

View File

@ -626,7 +626,7 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
}
#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT64
int32_t binary_exponent = 1;
int32_t binary_exponent = 33;
/*
* 128-bit mantissa storage
@ -635,9 +635,9 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
*/
ECMA_NUMBER_CONVERSION_128BIT_INTEGER (fraction_uint128);
ECMA_NUMBER_CONVERSION_128BIT_INTEGER_INIT (fraction_uint128,
0ull,
fraction_uint64 >> 32u,
(uint32_t) fraction_uint64,
0ull,
0ull);
/* Normalizing mantissa */

View File

@ -24,3 +24,5 @@ big++;
assert(big == 2147483649); // overflow on 32bit numbers
assert ((1152921504606846900).toString() === "1152921504606847000")
assert (1.797693134862315808e+308 === Infinity);