Skip to content

Conversation

@glistening
Copy link
Contributor

Keep sign for zero.
For example, 1 / (0 * (-1)) should be -Infinity, not +Infinity.

JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com

@glistening
Copy link
Contributor Author

It is related to #1855. When I checked it with jerry-test-suite and jerry-tests, there was no regression. And when I run benchmarks 10kk, and 1kk, it also shows no regression on x86_64. Could you check the correctness and run sunspider?

@zherczeg
Copy link
Member

The bug must be elsewhere. -0 is not an integer number in JerryScript. I suspect the division is the problem. Let me check.


if (ecma_are_values_integer_numbers (left_value, right_value))
if (left_value != 0 && right_value != 0 && ecma_are_values_integer_numbers (left_value, right_value))
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it is a bug with the multiplication but we need to move this check down to the if starting with:

if (-ECMA_INTEGER_MULTIPLY_MAX <= left_integer

Add:

&& left_integer != 0
&& right_integer != 0

@glistening
Copy link
Contributor Author

Ok. I'll move it. Thank you for review.

Keep sign for zero.
For example, 1 / (0 * (-1)) should be -Infinity, not +Infinity.

JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com
@LaszloLango LaszloLango added bug Undesired behaviour ecma core Related to core ECMA functionality labels May 30, 2017
Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Undesired behaviour ecma core Related to core ECMA functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants