// An Int represents a signed multi-precision integer.
// The zero value for an Int represents the value 0.
type Int struct {
- i C.mpz_t;
- init bool;
+ i C.mpz_t;
+ init bool;
}
// NewInt returns a new Int initialized to x.
// Bytes returns z's representation as a big-endian byte array.
func (z *Int) Bytes() []byte {
- b := make([]byte, (z.Len() + 7) / 8);
+ b := make([]byte, (z.Len() + 7)/8);
n := C.size_t(len(b));
C.mpz_export(unsafe.Pointer(&b[0]), &n, 1, 1, 1, 0, &z.i[0]);
return b[0:n];
)
var (
- tmp1 = big.NewInt(0);
- tmp2 = big.NewInt(0);
- numer = big.NewInt(1);
- accum = big.NewInt(0);
- denom = big.NewInt(1);
- ten = big.NewInt(10);
+ tmp1 = big.NewInt(0);
+ tmp2 = big.NewInt(0);
+ numer = big.NewInt(1);
+ accum = big.NewInt(0);
+ denom = big.NewInt(1);
+ ten = big.NewInt(10);
)
func extractDigit() int64 {
d = extractDigit();
}
eliminateDigit(d);
- fmt.Printf("%c", d + '0');
+ fmt.Printf("%c", d+'0');
if i++; i%50 == 0 {
fmt.Printf("\n");
import "stdio"
func main() {
-// stdio.Stdout.WriteString("hello, world\n");
+ // stdio.Stdout.WriteString("hello, world\n");
stdio.Puts("hello, world");
}