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

Invalid plan arising from integer rounding #189

Closed
bendbennett opened this issue May 6, 2022 · 1 comment · Fixed by #190
Closed

Invalid plan arising from integer rounding #189

bendbennett opened this issue May 6, 2022 · 1 comment · Fixed by #190
Labels
bug Something isn't working
Milestone

Comments

@bendbennett
Copy link
Contributor

Module version

github.com/hashicorp/terraform-plugin-framework v0.7.0

Relevant provider source code

"min": {
	Type:          types.Int64Type,
},
"max": {
	Type:          types.Int64Type,
},

Terraform Configuration Files

resource "random_integer" "integer_1" {
   max  = 7227701560655103598
   min  = 7227701560655103597
   seed = 12345
}

Debug Output

https://gist.github.com/bendbennett/6d9066c120883e17dcda25f0e98aec59

Expected Behavior

There should be no integer rounding.

Actual Behavior

Rounding is observed which causes an invalid plan.

Provider "registry.terraform.io/hashicorp/random" planned an invalid value
        for random_integer.integer_1.min: planned value
        cty.NumberIntVal(7.227701560655104e+18) does not match config value
        cty.NumberIntVal(7.227701560655103597e+18).

Steps to Reproduce

Use a 64 bit integer within a resource that uses Framework v0.7.0

@bendbennett bendbennett added the bug Something isn't working label May 6, 2022
@bendbennett bendbennett transferred this issue from hashicorp/terraform-plugin-framework May 11, 2022
@bflad bflad added this to the v0.10.0 milestone May 11, 2022
bendbennett added a commit that referenced this issue May 12, 2022
bendbennett added a commit that referenced this issue May 12, 2022
* Removing lossy conversion to big.Float (#189)

* Adding additional tests for MinInt64 and SmallestNonZeroFloat64 (#189)

* Adding changelog (#189)

* Update CHANGELOG for v0.9.1
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants