We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
GOARCH
go version
$ go version go1.19.1 darwin/arm64
yes
go env
$ go env GO111MODULE="on" GOARCH="arm64" GOBIN="" GOCACHE="/Users/humble/Library/Caches/go-build" GOENV="/Users/humble/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="arm64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/humble/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/humble/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64" GOVCS="" GOVERSION="go1.19.1" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/dev/null" GOWORK="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/tt/fs3zvlp53cgf_dtv5hhyc6cc0000gn/T/go-build2158361161=/tmp/go-build -gno-record-gcc-switches -fno-common"
Found some compatibility issues with arm64 and amd64 Due to this, I have changed all int64 amounts to uint64 to prevent this "bug".
arm64
amd64
Another solution would be reducing the MAX_ORDER of mints to 63
MAX_ORDER
63
package main import ( "fmt" "math" ) func main() { pow := math.Pow(float64(2), float64(64)) inti := int64(pow) fmt.Println(inti) }
Casting int64 returns different results based on GOARCH.
~/go/src/github.com/gohumble/cashu-feni arm_amd* 14:58:24 ❯ go run cmd/cashu/test.go 9223372036854775807
~/go/src/github.com/gohumble/cashu-feni arm_amd* 14:58:34 ❯ GOARCH=amd64 go run cmd/cashu/test.go -9223372036854775808
amd64 build should return the same int64 value
amd64 builds return different int64 values
The text was updated successfully, but these errors were encountered:
temporarily fixed in #31 by using uint64 instead of int64.
Sorry, something went wrong.
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Found some compatibility issues with
arm64
andamd64
Due to this, I have changed all int64 amounts to uint64 to prevent this "bug".
Another solution would be reducing the
MAX_ORDER
of mints to63
Script
Casting int64 returns different results based on
GOARCH
.What did you expect to see?
amd64 build should return the same int64 value
What did you see instead?
amd64 builds return different int64 values
The text was updated successfully, but these errors were encountered: