ztdep -8 Junior Poster in Training
#include <iostream>
#include<iomanip>
using namespace std;

#pragma warning(disable: 4800)
#include "mpirxx.h"
#pragma warning(default: 4800)

int main (int argc, char *argv[])
{   

   mpf_class sum(0.000000000000000000000000000000000000000000000000000000000000000,200);
  mpf_class con(0.0000001000000000000000000000000000000000000000000000000000000000,200);
   for(int i=0;i<10;i++)
      { sum=sum+con;
         cout <<scientific<<setprecision(50)<<sum<<"  "<<endl;
   }

the out put:

9.99999999999999954748111825886258685613938723690808e-08
1.99999999999999990949622365177251737122787744738162e-07
2.99999999999999986424433547765877605684181617107242e-07
3.99999999999999981899244730354503474245575489476323e-07
4.99999999999999977374055912943129342806969361845404e-07
5.99999999999999972848867095531755211368363234214485e-07
6.99999999999999968323678278120381079929757106583565e-07
7.99999999999999963798489460709006948491150978952646e-07
8.99999999999999959273300643297632817052544851321727e-07
9.99999999999999954748111825886258685613938723690808e-07
9.999999999999999547481118258862586856139387236908078193664551e-07

Dear friends:
I use MPIR(http://www.mpir.org/index.html) for the big float computation, but the result is very confusion.since i have use a big precision of 200 bits(it corresponds to about 64 bits precisions), but the results is still not the exact values. could you please give me some help. where is wrong.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.