Skip to content

XS: Incorrect string representation of 'NaN' #58

@tevador

Description

@tevador

On Windows (built with Visual Studio 2017, VC Tools 140):

xst.exe -e "print(NaN)"
-NaN

Prints -NaN instead of NaN. Same result when NaN is the result of an arithmetic operation:

xst.exe -e "print(void 0 + 1)"
-NaN

Interestingly, this gives the correct output:

xst.exe -e "print(-NaN)"
NaN

On Linux (built with GCC 6.3.0), NaN is represented correctly:

./xst -e "print(NaN)"
NaN

But this is incorrect:

./xst -e "print(-NaN)"
-NaN

NaN should not have a sign.

These are the relevant sections of the ECMAScript 6 specs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions