Standard library / math/big

big.Int.Quo()

Stores truncated integer quotient toward zero; zero divisor panics. Expected stdout: '-2\n'.

Formal Syntax & Structure

go syntaxgo
func (z *Int) Quo(x, y *Int) *Int

Parameters & Attributes

NameTypeDescription
x*IntFirst input operand (or sole input if unary).
y*IntSecond input operand.

Return Value

*Int

Stores truncated integer quotient toward zero; zero divisor panics.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math/big")
func main() {  fmt.Println(new(big.Int).Quo(big.NewInt(-7), big.NewInt(3)))}
Go Reference