Menu

BERC suggestion

2009-02-18
2012-09-15
  • Giuseppe Lippolis

    in the file "error_counters.h" I suggest to modify the line:

    00119 double errors;
    00120 double corrects;

    in :

    00119 long long unsigned int errors;
    00120 long long unsigned int corrects;

    In order to convince the developers community, I attach this simple test code:

      double DoubleVarA, DoubleVarB;
      unsigned int IntVarA, IntVarB;
      long long unsigned int LongVarA, LongVarB;
      IntVarA=IntVarB=DoubleVarB=DoubleVarA=LongVarA=LongVarB=18014398509481983;
      cout << DoubleVarA++ << "\t";
      cout << IntVarA++ << "\t";
      cout << LongVarA++ << "\t-" << endl;      
      cout << DoubleVarA << "\t";
      cout << IntVarA << "\t";
      cout << LongVarA << "\t=" << endl;
      cout << "---------------------------------------------" << endl;
      cout << DoubleVarA-DoubleVarB << "\t\t";
      cout << IntVarA-IntVarB << "\t\t";
      cout << LongVarA-LongVarB << "\t" << endl;
    

    bye bye

     
    • Adam Piątyszek

      Adam Piątyszek - 2009-02-18

      Guiseppe,

      Thanks for your suggestion. Anyway, instead of "long long unsigned" I would use "uint64_t", due to portability reasons. "long long" is not valid in MSVC++ world.

      You are welcome to provide a patch with the relevant changes. Thanks in advance!

      /Adam

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.