You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
306 B
15 lines
306 B
![]()
5 years ago
|
#include <gmp.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
int main() {
|
||
|
mpz_t i, j, k;
|
||
|
mpz_init_set_str (i, "1a", 16);
|
||
|
mpz_init (j);
|
||
|
mpz_init (k);
|
||
|
mpz_sqrtrem (j, k, i);
|
||
|
if (mpz_get_si (j) != 5 || mpz_get_si (k) != 1) abort();
|
||
|
printf("%s\n", "Works as expected");
|
||
|
return 0;
|
||
|
}
|