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

reflect: Determine equivalency of float32 or float64, and *big.Float via string representation #919

Merged
merged 4 commits into from
Feb 22, 2024

Conversation

bendbennett
Copy link
Contributor

Closes: #914

)

  * The reflect.Number function was handling float32 and float64 values
    by determining whether the value in the *big.Float generated through
    calling val.As() was an exact representation by examining the accuracy
    produced when calling Float32() or Float64() on the *big.Float
  * The reflect.Number function has been altered to verify whether the
    string representation, generated by calling Text(), of the generated
    *big.Float and a *big.Float created from the float32 or float64 value
    are identical
@bendbennett bendbennett added bug Something isn't working types Issues and pull requests about our types abstraction and implementations. reflection Issues and PRs about the reflection subsystem used to convert between attr.Values and Go values. labels Feb 6, 2024
Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question!

internal/reflect/number_test.go Show resolved Hide resolved
@bflad bflad added this to the v1.6.0 milestone Feb 21, 2024
Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀

@bendbennett bendbennett marked this pull request as ready for review February 22, 2024 06:43
@bendbennett bendbennett requested a review from a team as a code owner February 22, 2024 06:43
@bendbennett bendbennett merged commit 3c7a391 into main Feb 22, 2024
25 checks passed
@bendbennett bendbennett deleted the bendbennett/issues-914 branch February 22, 2024 06:49
bendbennett added a commit to hashicorp/terraform-provider-corner that referenced this pull request Feb 22, 2024
bendbennett added a commit to hashicorp/terraform-provider-corner that referenced this pull request Mar 6, 2024
* Adding function tests for framework protocol 5 & 6 and protocol 6 mux providers (#202)

* Adding copyright headers (#202)

* Linting (#202)

* Adding function tests for protocol v5 and protocol v6 providers (#202)

* Amending provider defined function tests for number until bug fix on go.cty is released (#202)

* Adding function testing for mux providers (#202)

* Adding function testing for tf6to5provider (#202)

* Adding copyright headers (#202)

* Bumping terraform-plugin-framework version to latest (#202)

Latest terraform-plugin-framework contains fix for:
  * hashicorp/terraform-plugin-framework#914
  * hashicorp/terraform-plugin-framework#919

* Bumping terraform-plugin-testing to v1.7.0 (#202)

* Refactoring to return function.FuncError (#202)

* Updates following code review (#202)
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Mar 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working reflection Issues and PRs about the reflection subsystem used to convert between attr.Values and Go values. types Issues and pull requests about our types abstraction and implementations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert to number error when storing a value in float64 during execution of provider-defined function
2 participants