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] Reference equality checks incorrect for equal decimal values with different precision #17984

Closed
MaryamZi opened this issue Aug 19, 2019 · 1 comment
Labels
Spec/2019R3 Related to Ballerina Spec 2019R3 Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/SpecDeviation

Comments

@MaryamZi
Copy link
Member

Description:
According to the 2019r3 spec
"For the decimal type, the operators differ in whether they consider the precision of the value. For example, 1.0 == 1.00 is true but 1.0 === 1.00 is false."

Steps to reproduce:

import ballerina/io;

public function main(string... args) {
    decimal d1 = 1.0;
    decimal d2 = 1.00;

    io:println(d1 == d2);   // true
    io:println(d1 === d2);  // also true, but should be false
}

Affected Versions:
1.0.0-beta-SNAPSHOT - 15th August build

Related Issues:
#11913

@MaryamZi MaryamZi added Type/SpecDeviation Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime labels Aug 19, 2019
@pubudu91 pubudu91 added the Spec/2019R3 Related to Ballerina Spec 2019R3 label Oct 18, 2019
@HindujaB
Copy link
Contributor

HindujaB commented Dec 8, 2021

This is fixed in the ballerina slbeta5. Hence closing this issue.

@HindujaB HindujaB closed this as completed Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Spec/2019R3 Related to Ballerina Spec 2019R3 Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/SpecDeviation
Projects
None yet
Development

No branches or pull requests

3 participants