Standard library / math/big
big.Int.MulRange()
Multiply all integers in inclusive range a through b. Empty ranges return one. This method writes to the receiver (use a separate destination to preserve inputs when needed). Expected stdout: '360 1\n'.
Formal Syntax & Structure
go syntaxgo
func (z *Int) MulRange(a, b int64) *IntParameters & Attributes
| Name | Type | Description |
|---|---|---|
| a | int64 | Inclusive lower bound. |
| b | int64 | Inclusive upper bound. |
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(new(big.Int).MulRange(3, 6), new(big.Int).MulRange(6, 3))}