[ create a new paste ] login | about

Project: programmingpraxis
Link: http://programmingpraxis.codepad.org/xbg11nxk    [ raw code | fork ]

programmingpraxis - C, pasted on Feb 7:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* bigprime.c -- save the digits of 2^57885161-1 to a file */

#include <stdio.h>
#include "gmp.h"

void main(void)
{
    mpz_t p;
    FILE *fp;
    fp = fopen("bigprime.txt","w");
    mpz_init(p);
    mpz_ui_pow_ui(p, 2, 57885161);
    mpz_sub_ui(p, p, 1);
    gmp_fprintf(fp, "%Zd", p);
    mpz_clear(p);
    fclose(fp);
}


Create a new paste based on this one


Comments: