Skip to content

Instantly share code, notes, and snippets.

@cr0sh
Created April 17, 2016 16:36
Show Gist options
  • Save cr0sh/d9073fbe19a8e723374c83fe222a5678 to your computer and use it in GitHub Desktop.
Save cr0sh/d9073fbe19a8e723374c83fe222a5678 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"io/ioutil"
"math/big"
"os"
"strconv"
"time"
)
func main() {
n, err := strconv.ParseInt(os.Args[1], 10, 64)
if err != nil {
panic(err)
}
r := big.NewInt(1)
start := time.Now()
r.MulRange(1,n)
fmt.Println("Elapsed:", time.Since(start))
ioutil.WriteFile("result.txt", []byte(r.String()), 0644)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment