Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spec Deviation] Incorrect results for reference equality checks with float NaN/NaN and -0.0/+0.0 #11913

Closed
MaryamZi opened this issue Nov 27, 2018 · 3 comments
Labels
Area/Compiler Area/JVMCodeGen JVM code generation module Priority/Low Status/Duplicate Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug Type/SpecDeviation

Comments

@MaryamZi
Copy link
Member

Description:
Value equality checks for NaN/NaN and -0.0/+0.0 currently evaluate to true as follows:

NaN != NaN
-0.0 == +0.0

Reference equality checks for NaN/NaN and -0.0/+0.0 are expected to evaluate to true for:

NaN === NaN
-0.0 !== +0.0

Currently the reference equality checks fail since we consider the reference equality checks for simple basic types to be the same as value equality checks.

@MaryamZi
Copy link
Member Author

As per the new spec (v0.990:2018-12-DD), evaluation needs to happen as follows:

NaN === NaN; // true
NaN == NaN; // true

-0.0 === +0.0 // false
-0.0 == +0.0 // true

@Anoukh
Copy link
Member

Anoukh commented Jan 14, 2019

decimal type should support division by zero as well

@MaryamZi MaryamZi assigned MaryamZi and pranavan15 and unassigned MaryamZi Feb 11, 2019
@anupama-pathirage anupama-pathirage added the Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. label Apr 30, 2019
@anupama-pathirage anupama-pathirage added Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime and removed Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. labels Aug 5, 2019
@hasithaa
Copy link
Contributor

hasithaa commented Feb 2, 2021

Duplicates #17977

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Compiler Area/JVMCodeGen JVM code generation module Priority/Low Status/Duplicate Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug Type/SpecDeviation
Projects
None yet
Development

No branches or pull requests

5 participants