~ubuntu-branches/ubuntu/saucy/igraph/saucy-proposed

« back to all changes in this revision

Viewing changes to src/bliss_bignum.hh

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2011-03-16 23:42:10 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110316234210-qemm8n2yfk0srsw1
Tags: 0.5.4-1
* New upstream.

* control: Change depends libgmp3-dev --> libgmp-dev.  Update
  Standards-Version to 3.9.1.

* rules: empty out dependency_libs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
  BigNum(): v(0.0) {}
75
75
  void assign(const int n) {v = (long double)n; }
76
76
  void multiply(const int n) {v *= (long double)n; }
 
77
#ifdef WIN64
 
78
  int print(FILE *fp) {return fprintf(fp, "%g", (double)v); }
 
79
#else
77
80
  int print(FILE *fp) {return fprintf(fp, "%Lg", v); }
 
81
#endif
78
82
  int tostring(char **str) {
79
83
    int size=static_cast<int>( (logbl(fabsl(v))/log(10.0))+4 );
80
84
    *str=igraph_Calloc(size, char );
81
85
    if (! *str) {
82
86
      IGRAPH_ERROR("Cannot convert big number to string", IGRAPH_ENOMEM);
83
87
    }
 
88
#ifdef WIN64
 
89
    snprintf(*str, size, "%.0f", (double)v);
 
90
#else
84
91
    snprintf(*str, size, "%.0Lf", v);
 
92
#endif
85
93
    return 0;
86
94
  }
87
95
};