Skip to content
Snippets Groups Projects
Unverified Commit 99207738 authored by takt's avatar takt Committed by GitHub
Browse files

Merge pull request #148 from corny/bitshift

Know how to shift
parents 1baef567 54d1284f
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@ func StrToAddr(x string) (uint32, error) {
return 0, fmt.Errorf("%d is too big for a uint8", y)
}
ret += uint32(math.Pow(256, float64(3-i))) * uint32(y)
ret += uint32(y) << uint((3-i)*8)
}
return ret, nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment