benfordgenerator

C Library and cli application to generate number sequences with first digits distributed according to Benford's Law
git clone git://git.defalsify.org/libbenford.git
Info | Log | Files | Refs

benford.h (399B)


      1 #ifndef BENFORD_H_
      2 #define BENFORD_H_
      3 
      4 typedef struct benford {
      5 	char counts[9];
      6 	int total;
      7 } benford_t;
      8 
      9 benford_t* benford_new();
     10 void benford_free(benford_t* bf);
     11 int benford_set(benford_t* bf, long int* number);
     12 int benford_setf(benford_t* bf, float* number);
     13 
     14 // private functions
     15 void benford_setLead_(long int* subject, int lead);
     16 int benford_nextLead_(benford_t* bf);
     17 
     18 #endif // BENFORD_H_