root/trunk/gmp/gmptest.d

Revision 271, 509 bytes (checked in by mp4, 4 years ago)

--

Line 
1 //import gmpheadertest;
2 import gmp;
3 import std.c.stdlib;
4 import std.stdio;
5 import std.string;
6 void main()
7 {
8 mpf_t a;   
9 mpf_init(&a);  
10 mpf_init2 (&a, 32);
11 mpf_set_ui (&a, 4444);
12 mp_exp_t expptr;
13 char * curres=cast(char*)  malloc(40);
14 if (mpf_cmp_ui (&a, 1)>0)
15 {
16     printf(">1 yes");
17 }  
18 if (mpf_cmp_ui (&a, 2)>0)
19 {
20     printf(">2 yes");
21 }  
22 if (mpf_cmp_ui (&a, 2)==0)
23 {
24     printf("==2 yes");
25 }
26     writefln("xx");
27 mpf_get_str (curres, &expptr, 10, 0, &a);
28
29         writefln(toString(curres));
30 }  
Note: See TracBrowser for help on using the browser.