Skip to content

Commit

Permalink
Improved rate averaging function
Browse files Browse the repository at this point in the history
  • Loading branch information
microsounds committed Apr 16, 2016
1 parent 6160466 commit 4056800
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tripforce.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ unsigned trip_frequency(enum _avg_stats mode)
if (current_time != time_at_last_call)
{
/* floating point divsion runs marginally faster */
average = (average + current_tally) / 2.0;
average = (average / 2.0) + (current_tally / 2.0);
current_tally = 1;
}
else
Expand Down

0 comments on commit 4056800

Please sign in to comment.