Пример #1
0
func main() {
	c, n := fmpz.NewInt(0), fmpz.NewInt(0)

	flag.Parse()
	if flag.NArg() == 1 {
		err := n.SetString(flag.Arg(0), 10)
		if err != nil {
			fmt.Println("Syntax: delta_qexp <integer>")
			fmt.Println("where <integer> is the (positive) number of terms to compute")
			fmt.Println("Error: Can not parse argument:", flag.Arg(0))
			os.Exit(1)
		}
	}

	if flag.NArg() != 1 || fmpz.CmpInt(n, fmpz.NewInt(1)) == -1 {
		fmt.Println("Syntax: delta_qexp <integer>")
		fmt.Println("where <integer> is the (positive) number of terms to compute")
		os.Exit(1)
	}

	arith.RamanujanTau(c, n)

	fmt.Printf("Coefficient of q^%v is %v\n", n, c)
	os.Exit(0)
}
Пример #2
0
// String returns the decimal representation of z.
func (z *Rat) String() string {
	i := fmpz.NewInt(0)
	p := z.Num(i).String()
	q := z.Denom(i).String()
	return p + "/" + q
}