Skip to content

Conversation

@ossy-szeged
Copy link
Contributor

The Math.pow implementation calls libm's pow. The ISO C and ES5.1
standards differ on some special cases of pow. jerry-libm is already
ES5.1 conform, but system libm libraries on Linux and Windows aren't.

Math.pow(NaN, +/-0.0) is NaN on Windows and Linux with system libm,
but should be 1.0 according to ES5.1 / 15.8.2.13.

This patch handles this special case in Math.pow instead of calling pow of libm.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu

The Math.pow implementation calls libm's pow. The ISO C and ES5.1
standards differ on some special cases of pow. jerry-libm is already
ES5.1 conform, but system libm libraries on Linux and Windows aren't.

Math.pow(NaN, +/-0.0) is NaN on Windows and Linux with system libm,
but should be 1.0 according to ES5.1 / 15.8.2.13.

This patch handles this special case in Math.pow instead of calling pow of libm.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
Copy link
Member

@akosthekiss akosthekiss 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
Contributor

@galpeter galpeter left a comment

Choose a reason for hiding this comment

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

lgtm

@akosthekiss akosthekiss merged commit 7685afd into jerryscript-project:master Jul 24, 2019
@ossy-szeged ossy-szeged deleted the pow-fix branch August 2, 2019 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants