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

remove compilation warning in OTP26.1 #107

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

gonzalobf
Copy link

In OTP-27, +0.0 and -0.0 will no longer be the exact number so they added a compilation warning in OTP-26.1 to warn when a float 0.0 is getting match without specifying the sign:

rebar3 compile                                                                                                                                                                               0s
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling recon
src/recon_alloc.erl:706:7: Warning: matching on the float 0.0 will no longer also match -0.0 in OTP 27. If you specifically intend to match 0.0 alone, write +0.0 instead.
src/recon_alloc.erl:706:11: Warning: matching on the float 0.0 will no longer also match -0.0 in OTP 27. If you specifically intend to match 0.0 alone, write +0.0 instead.

Longer explanation about why are not the same [1]

Pull request adding the warning [2]

[1] https://erlangforums.com/t/in-erlang-otp-27-0-0-will-no-longer-be-exactly-equal-to-0-0/2586
[2] erlang/otp#7521

In OTP-27, `+0.0` and `-0.0` will no longer be the exact number so they
added a compilation warning in OTP-26.1 to warn when a float 0.0 is
getting match without specifying the sign:

```
rebar3 compile                                                                                                                                                                               0s
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling recon
src/recon_alloc.erl:706:7: Warning: matching on the float 0.0 will no longer also match -0.0 in OTP 27. If you specifically intend to match 0.0 alone, write +0.0 instead.
src/recon_alloc.erl:706:11: Warning: matching on the float 0.0 will no longer also match -0.0 in OTP 27. If you specifically intend to match 0.0 alone, write +0.0 instead.
```

Longer explanation about why are not the same [1]

Pull request adding the warning [2]

[1] https://erlangforums.com/t/in-erlang-otp-27-0-0-will-no-longer-be-exactly-equal-to-0-0/2586
[2] erlang/otp#7521
@ferd ferd merged commit fab61ce into ferd:master Sep 22, 2023
9 checks passed
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.

2 participants