Standard library / math/big

big.Int.And()

Compute bitwise AND using conceptual infinite two's-complement representation for signed integers. This method writes to the receiver (use a separate destination to preserve inputs when needed). Expected stdout: '8\n'.

Formal Syntax & Structure

go syntaxgo
func (z *Int) And(x, y *Int) *Int

Parameters & Attributes

NameTypeDescription
x*IntNumeric operand supplied to this method.
y*IntNumeric operand supplied to this method.

Return Value

*Int

Returns the result described above; see the example for the observed behavior.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math/big")
func main() {  fmt.Println(new(big.Int).And(big.NewInt(13), big.NewInt(10)))}
Go Reference