Reverting c2933d9e44eb5346161964c7c52f1ca793c4c7b4 changes of ecma_number_{is,make}_infinity routines.
This commit is contained in:
@@ -338,20 +338,9 @@ ecma_number_t
|
|||||||
ecma_number_make_infinity (bool sign) /**< true - for negative Infinity,
|
ecma_number_make_infinity (bool sign) /**< true - for negative Infinity,
|
||||||
false - for positive Infinity */
|
false - for positive Infinity */
|
||||||
{
|
{
|
||||||
const ecma_number_t positive_infinity = ECMA_NUMBER_ONE / ECMA_NUMBER_ZERO;
|
return ecma_number_pack (sign,
|
||||||
const ecma_number_t negative_infinity = ecma_number_negate (positive_infinity);
|
(1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1u,
|
||||||
|
0u);
|
||||||
ecma_number_t sign_infinity = (sign ? negative_infinity : positive_infinity);
|
|
||||||
|
|
||||||
#ifndef JERRY_NDEBUG
|
|
||||||
ecma_number_t sign_infinity_ieee754 = ecma_number_pack (sign,
|
|
||||||
(1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1u,
|
|
||||||
0u);
|
|
||||||
|
|
||||||
JERRY_ASSERT (sign_infinity == sign_infinity_ieee754);
|
|
||||||
#endif /* !JERRY_NDEBUG */
|
|
||||||
|
|
||||||
return sign_infinity;
|
|
||||||
} /* ecma_number_make_infinity */
|
} /* ecma_number_make_infinity */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -405,24 +394,12 @@ ecma_number_is_infinity (ecma_number_t num) /**< ecma-number */
|
|||||||
{
|
{
|
||||||
JERRY_ASSERT (!ecma_number_is_nan (num));
|
JERRY_ASSERT (!ecma_number_is_nan (num));
|
||||||
|
|
||||||
const ecma_number_t positive_infinity = ECMA_NUMBER_ONE / ECMA_NUMBER_ZERO;
|
|
||||||
const ecma_number_t negative_infinity = -positive_infinity;
|
|
||||||
|
|
||||||
bool is_infinity = (num == positive_infinity || num == negative_infinity);
|
|
||||||
|
|
||||||
#ifndef JERRY_NDEBUG
|
|
||||||
uint32_t biased_exp = ecma_number_get_biased_exponent_field (num);
|
uint32_t biased_exp = ecma_number_get_biased_exponent_field (num);
|
||||||
uint64_t fraction = ecma_number_get_fraction_field (num);
|
uint64_t fraction = ecma_number_get_fraction_field (num);
|
||||||
|
|
||||||
/* IEEE-754 2008, 3.4, b */
|
/* IEEE-754 2008, 3.4, b */
|
||||||
|
return ((biased_exp == (1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1)
|
||||||
bool is_infinity_ieee754 = ((biased_exp == (1u << ECMA_NUMBER_BIASED_EXP_WIDTH) - 1)
|
&& (fraction == 0));
|
||||||
&& (fraction == 0));
|
|
||||||
|
|
||||||
JERRY_ASSERT (is_infinity == is_infinity_ieee754);
|
|
||||||
#endif /* !JERRY_NDEBUG */
|
|
||||||
|
|
||||||
return is_infinity;
|
|
||||||
} /* ecma_number_is_infinity */
|
} /* ecma_number_is_infinity */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user