Standard library / math/big
big.Int.Lsh()
Shift left by n bits, equivalent to multiplying by two to the n without fixed-width overflow. This method writes to the receiver (use a separate destination to preserve inputs when needed). Expected stdout: '1180591620717411303424\n'.
Formal Syntax & Structure
go syntaxgo
func (z *Int) Lsh(x *Int, n uint) *IntParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | *Int | Numeric operand supplied to this method. |
| n | uint | Count, bound, modulus or shift amount, as described above. |
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).Lsh(big.NewInt(1), 70))}