Standard library / math/big
big.Rat.Mul()
Multiplies rational operands exactly. Expected stdout: '1/2\n'.
Formal Syntax & Structure
go syntaxgo
func (z *Rat) Mul(x, y *Rat) *RatParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | *Rat | First input operand (or sole input if unary). |
| y | *Rat | Second input operand. |
Return Value
*Rat
Multiplies rational operands exactly.
Working Example
Example Snippetgo
package main
import ( "fmt" "math/big")
func main() { fmt.Println(new(big.Rat).Mul(big.NewRat(2, 3), big.NewRat(3, 4)))}