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

value: add BigInt.Float64 for Go 1.20 and older #152

Closed
wants to merge 1 commit into from
Closed

value: add BigInt.Float64 for Go 1.20 and older #152

wants to merge 1 commit into from

Conversation

dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Aug 11, 2023

In Go 1.21, big.Int got a new method Float64 (proposal golang/go#56984).
In Go 1.21, BigInt has that method because it embeds *big.Int.
In Go 1.20 and older, it's possible to implement it ourselves.

The README and go.mod say that ivy requires Go 1.17 to be built, so
add the Float64 implementation with an appropriate build constraint.

In Go 1.21, big.Int got a new method Float64 (proposal golang/go#56984).
In Go 1.21, BigInt has that method because it embeds *big.Int.
In Go 1.20 and older, it's possible to implement it ourselves.

The README and go.mod say that ivy requires Go 1.17 to be built, so
add the Float64 implementation with an appropriate build constraint.
@dmitshur dmitshur mentioned this pull request Aug 11, 2023
@dmitshur
Copy link
Contributor Author

I tested this on Go 1.17.13 by running GOTOOLCHAIN=go1.17.13 go test ./.... It fixes the build error, and all tests pass other than testdata/sys.ivy:85 (this is #151) and TestHelp (not related).

@robpike
Copy link
Owner

robpike commented Aug 11, 2023

Thanks but I just bumped to 1.21

@robpike robpike closed this Aug 11, 2023
@dmitshur dmitshur deleted the bigint-float64-go117 branch August 11, 2023 05:53
@fzipp
Copy link
Contributor

fzipp commented Aug 11, 2023

Just a suggestion:
You can create a .github/workflows/build.yml file like this in the repository, and GitHub will run the tests for you with the Go version specified by "go-version" on each push, and notify you on failure.

It being in a dotfile directory and YAML is not beautiful, but it does the job.

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.

3 participants