Standard library / math/big
big.Int.Or()
Compute bitwise inclusive OR on signed arbitrary-precision integers. This method writes to the receiver (use a separate destination to preserve inputs when needed). Expected stdout: '15\n'.
Formal Syntax & Structure
go syntaxgo
func (z *Int) Or(x, y *Int) *IntParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | *Int | Numeric operand supplied to this method. |
| y | *Int | Numeric 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).Or(big.NewInt(12), big.NewInt(3)))}