-
Notifications
You must be signed in to change notification settings - Fork 379
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
mixing untyped (negative) floats and integers in arithmetic sometimes drops the sign #1152
Comments
Do we mean unsigned here, not untyped? |
Nope, untyped. In Go syntax, constant expressions (like That is to say that if we had the variables |
Right, understood. So since there is no declaration, this is where type inference can be incorrect. I was thinking that |
Addresses #1152 After debugging for a bit it became apparent the sign was being dropped during the operation in the `apd` module. Upgrading to the latest version fixes this. <!-- please provide a detailed description of the changes made in this pull request. --> <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
Addresses gnolang#1152 After debugging for a bit it became apparent the sign was being dropped during the operation in the `apd` module. Upgrading to the latest version fixes this. <!-- please provide a detailed description of the changes made in this pull request. --> <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
I don't want to investigate precisely what happens right now; in any case, these are some equivalent expressions and their output in
gno repl
:It seems that if a division happens between an untyped bigint and an untyped bigdec, the sign is dropped.
The text was updated successfully, but these errors were encountered: