Standard library / math/big
big.Int.SetInt64()
Assign a signed 64-bit integer exactly. This method writes to the receiver (use a separate destination to preserve inputs when needed). Expected stdout: '-42\n'.
Formal Syntax & Structure
go syntaxgo
func (z *Int) SetInt64(x int64) *IntParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | int64 | 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).SetInt64(-42))}