Standard library / math/big

big.Rat.Denom()

Return the positive denominator. Usually aliases internal storage; copy it before independent mutation. Uninitialized zero returns a fresh one. Expected stdout: '4 1\n'.

Formal Syntax & Structure

go syntaxgo
func (x *Rat) Denom() *Int

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(big.NewRat(6, -8).Denom(), new(big.Rat).Denom())}
Go Reference