Skip to content

Bug in division of bytes on amd64 #2206

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

Closed
gopherbot opened this issue Aug 30, 2011 · 3 comments
Closed

Bug in division of bytes on amd64 #2206

gopherbot opened this issue Aug 30, 2011 · 3 comments

Comments

@gopherbot
Copy link
Contributor

by [email protected]:

package main

func main() {
        // 5
    println(5 / (5 / 3))

        // 5
    println(byte(5) / (byte(5) / byte(3)))

        // 5
    var a, b byte = 5, 3
    println(a / (a / b))
    
    // integer divide by zero in golang.org sandbox
    // 0 on windows/amd64
    x := [3]byte{2, 3, 5}
    println(x[2] / (x[2] / x[1]))

    // integer divide by zero in golang.org sandbox
    // crash on windows/amd64
    y := x[1:3]
    println(y[1] / (y[1] / y[0]))
}
@gopherbot
Copy link
Contributor Author

Comment 1 by [email protected]:

same with int8, uint8, int16, uint16

@rsc
Copy link
Contributor

rsc commented Aug 30, 2011

Comment 2:

Nice bug.

Owner changed to @rsc.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Aug 31, 2011

Comment 3:

*** Submitted as
http://code.google.com/p/go/source/detail?r=fc60ef40030f ***
gc: fix div bug
R=ken2
CC=golang-dev

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
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

2 participants