Standard library / math/big

big.Rat.Quo()

Divide rational x by y exactly; zero divisor panics. This method writes to the receiver (use a separate destination to preserve inputs when needed). Expected stdout: '5/6\n'.

Formal Syntax & Structure

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

Parameters & Attributes

NameTypeDescription
x*RatNumeric operand supplied to this method.
y*RatNumeric operand supplied to this method.

Return Value

*Rat

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.Rat).Quo(big.NewRat(2, 3), big.NewRat(4, 5)))}
Go Reference