From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id EF3256931 for ; Tue, 1 Nov 2016 02:53:02 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 31 Oct 2016 18:53:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,577,1473145200"; d="scan'208";a="896248452" Received: from rhorton-mobl.ger.corp.intel.com (HELO [10.239.205.98]) ([10.239.205.98]) by orsmga003.jf.intel.com with ESMTP; 31 Oct 2016 18:53:00 -0700 To: dev@dpdk.org References: <1477616671-9547-1-git-send-email-remy.horton@intel.com> <1477616671-9547-3-git-send-email-remy.horton@intel.com> <98CBD80474FA8B44BF855DF32C47DC359EA8CD@smartserver.smartshare.dk> From: Remy Horton Organization: Intel Shannon Limited Message-ID: <3cc43e20-4d48-610f-a74f-f22b902af13a@intel.com> Date: Tue, 1 Nov 2016 09:53:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC359EA8CD@smartserver.smartshare.dk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: =?UTF-8?Q?Morten_Br=c3=b8rup?= Subject: Re: [dpdk-dev] [RFC PATCH v2 2/3] lib: add bitrate statistics library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Nov 2016 01:53:03 -0000 On 28/10/2016 15:39, Morten Brørup wrote: > Comments below. [..] > When working with statistical calculations using integer arithmetic, > you should round off the integer result by adding 0.5 to the result, > which you do by adding half of the divisor to the dividend, like > this: > > delta = (delta * alpha_percent + 50) / 100; > > The numbers in this particular case are probably very big, so not > rounding off doesn't affect the result a lot; but then you should add > a comment about why rounding down is acceptable. A minor point, but will roll it into the next patchset.