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

runtime % result in less zeros values #40004

Closed
MasterDimmy opened this issue Jul 2, 2020 · 2 comments
Closed

runtime % result in less zeros values #40004

MasterDimmy opened this issue Jul 2, 2020 · 2 comments

Comments

@MasterDimmy
Copy link

What version of Go are you using (go version)?

$ go version
 go1.14.4 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
AMD64
Windows

What did you do?

fmt.Printf("x=%d", (115-303)%1626)

output:
x=-188

https://play.golang.org/p/yYVbpJYbp-L

What did you expect to see?

x=1438

What did you see instead?

x=-188

Reminder by module deviding cant be less zero !

@D1CED
Copy link

D1CED commented Jul 2, 2020

@randall77
Copy link
Contributor

This is as specified in the spec: https://golang.org/ref/spec#Arithmetic_operators

@golang golang locked and limited conversation to collaborators Jul 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants