Standard library / math/big

big.Int.String()

Return the signed decimal representation. Expected stdout: '-42\n'.

Formal Syntax & Structure

go syntaxgo
func (x *Int) String() string

Return Value

string

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(big.NewInt(-42).String())}
Go Reference