Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int i,j;
- ofstream ofile;
- ofile.open(filename);
- for(j=0;j<2;j++)
- {
- if(j==0) ofile<<"A + B =";
- else ofile<<"A - B =";
- if(r[j].sign==0) ofile<<'-';
- for(i=r[j].length-1;i>=0;i--)
- {
- ofile<<r[j].data[i];
- //cout<<r[j].data[i];
- }
- ofile<<endl;
- //cout<<endl;
- }
- if(islessthan(a,b)==1)
- {
- hold=a;
- a=b;
- b=hold;
- r.sign=0;
- }.
- bool islessthan(BIGNUMBER a,BIGNUMBER b)
- {
- int i;
- if(a.length<b.length) return 1;
- else if(a.length>b.length) return 0;
- else
- {
- for(i=a.length-1;i>=0;i++)
- {
- if(a.data[i]>b.data[i]) return 0;
- }
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement