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

Hex floating point literals are always float #14775

Closed
rdhananjaya opened this issue Mar 29, 2019 · 1 comment · Fixed by #22640
Closed

Hex floating point literals are always float #14775

rdhananjaya opened this issue Mar 29, 2019 · 1 comment · Fixed by #22640
Assignees
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug Type/SpecDeviation

Comments

@rdhananjaya
Copy link
Member

Description:
Fix $subject in [1] and other places

[1] - tests/ballerina-spec-conformance-tests/S05_simple_values/tests/floating-point-types/decimal.bal

Please refer James response in ballerina-platform/ballerina-spec#50

@anupama-pathirage anupama-pathirage added the Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. label Aug 5, 2019
@hasithaa
Copy link
Contributor

Spec says, The decimal type corresponds to a subset of IEEE 754-2008 128-bit decimal (radix 10) floating point numbers. Any decimal value can be represented by a DecimalFloatingPointNumber with an optional DecimalTypeSuffix.

But following behaviour observed with 1.0.2 release.

public function main() {
    decimal d1 = 0x12abc;    // Should fail, but no compiler errors.
    decimal d2 = 0xab.ce1;   // Correct. Fails with "incompatible types: expected 'decimal', found 'float'" 
}

@rdhananjaya rdhananjaya added Points/3 Equivalent to three days effort Points/4 Equivalent to four day effort and removed Points/3 Equivalent to three days effort labels Apr 2, 2020
@pubudu91 pubudu91 removed the Points/4 Equivalent to four day effort label Apr 16, 2020
@pubudu91 pubudu91 added this to the Ballerina 1.3.0 milestone Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug Type/SpecDeviation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants