Standard library / math/big
big.Int.Rem()
Stores remainder for truncated quotient; sign follows dividend if nonzero. Expected stdout: '-1\n'.
Formal Syntax & Structure
go syntaxgo
func (z *Int) Rem(x, y *Int) *IntParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | *Int | First input operand (or sole input if unary). |
| y | *Int | Second input operand. |
Return Value
*Int
Stores remainder for truncated quotient; sign follows dividend if nonzero.
Working Example
Example Snippetgo
package main
import ( "fmt" "math/big")
func main() { fmt.Println(new(big.Int).Rem(big.NewInt(-7), big.NewInt(3)))}