Skip to content

Commit

Permalink
Merge pull request #17 from alloyproject/3.0
Browse files Browse the repository at this point in the history
change to doubles
  • Loading branch information
alloyproject committed Apr 28, 2018
2 parents 4afd5c0 + 8c7dd9f commit 2094f7a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/CryptoNoteCore/Currency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,10 @@ if (blockIndex >= (UPGRADE_HEIGHT_V5-1) && blockIndex <= (UPGRADE_HEIGHT_V5+DIFF
size_t length = timestamps.size();
assert(length == cumulativeDifficulties.size());

int64_t t = 0,d=0;
uint64_t t = 0,d=0;

int solvetime=0;
int diff=0;
int64_t solvetime=0;
int64_t diff=0;

for (size_t i = 1; i < length; i++) {
solvetime = timestamps[i] - timestamps[i-1];
Expand All @@ -499,9 +499,9 @@ d+=diff;
}


float avgtime=t/length;
float avgdiff=d/length;
float adj=T/avgtime;
double avgtime=t/length;
double avgdiff=d/length;
double adj=T/avgtime;


uint64_t nextDiffZ = avgdiff*adj;
Expand Down

0 comments on commit 2094f7a

Please sign in to comment.