Created
March 18, 2013 16:59
-
-
Save gebi/5188792 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os" | |
"fmt" | |
"log" | |
"strconv" | |
"github.com/cznic/mathutil" | |
) | |
func main() { | |
i, err := strconv.ParseUint(os.Args[1], 0, 64) | |
if err != nil { | |
log.Fatal("Could not parse number: \"", os.Args[1], "\"") | |
} | |
prime, ok := mathutil.NextPrimeUint64(i) | |
if !ok { | |
log.Fatal("Could not find next prime for: ", i) | |
} | |
fmt.Println(prime) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment