Standard library / math/big
big.NewInt()
Creates a mutable arbitrary-precision signed integer initialized from int64. Expected stdout: '-42\n'.
Formal Syntax & Structure
go syntaxgo
func NewInt(x int64) *IntParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | int64 | First input operand (or sole input if unary). |
Return Value
*Int
Creates a mutable arbitrary-precision signed integer initialized from int64.
Working Example
Example Snippetgo
package main
import ( "fmt" "math/big")
func main() { fmt.Println(big.NewInt(-42))}