From f249126ed44b6fea6f467e6573fc3f2f8e013c0d Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 20 Sep 2017 22:56:19 +0200 Subject: [PATCH] Revert "Fixed a typo and added some parentheses to the new equations for the sake of readability." This reverts commit 93b57db17f0ba64c9e2f752a1ca4cab36e851a86. --- request.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/request.c b/request.c index 4b2e9dd4..39059635 100644 --- a/request.c +++ b/request.c @@ -559,7 +559,7 @@ void getForwardDestinations(char *client_message, int *sock) // To get the total percentage of a specific query on the total number of queries, // we simply have to scale b by a which is what we do in the following. if(forwardedsum > 0 && counters.queries > 0) - percentage = 1e2 * (forwarded[j].count / forwardedsum) * (counters.forwardedqueries / counters.queries); + percentage = 1e2 * forwarded[j].count / forwardedsum * counters.forwardedqueries / counters.queries; else percentage = 0.0; allocated = false; @@ -918,7 +918,7 @@ void getForwardDestinationsOverTime(int *sock) // // To get the total percentage of a specific forward destination on the total // number of queries, we simply have to multiply a and b as done below: - percentage = 1e2 * (thisforward / forwardedsum) * (overTime[i].total - (overTime[i].cached + overTime[i].blocked)) / overTime[i].total; + percentage = 1e2 * thisforward / forwardedsum * (overTime[i].total - (overTime[i].cached + overTime[i].blocked)) / overTime[i].total; } else { @@ -930,7 +930,7 @@ void getForwardDestinationsOverTime(int *sock) // Avoid floating point exceptions if(overTime[i].total > 0) - // Forward count for destination "local" is cached + blocked normalized by total: + // Forward count for destinatio "local" is cached + blocked normalized by total: percentage = 1e2 * (overTime[i].cached + overTime[i].blocked) / overTime[i].total; else percentage = 0.0;