From owner-freebsd-wireless@FreeBSD.ORG Thu Dec 1 00:11:58 2011 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id C1431106566C; Thu, 1 Dec 2011 00:11:58 +0000 (UTC) Date: Thu, 1 Dec 2011 00:11:58 +0000 From: Alexander Best To: Igor Mozolevsky Message-ID: <20111201001158.GA48051@freebsd.org> References: <20111130224422.GA36424@freebsd.org> <20111201000243.GB44877@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: freebsd-wireless@freebsd.org Subject: Re: comparing floating points via "==" or "!=" X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2011 00:11:58 -0000 On Thu Dec 1 11, Igor Mozolevsky wrote: > On 1 December 2011 00:02, Alexander Best wrote: > > On Wed Nov 30 11, Igor Mozolevsky wrote: > >> On 30 November 2011 22:44, Alexander Best wrote: > >> > >> > i played a bit with the gcc -Wfloat-equal warning and noticed that inside > >> > sys/dev/ath/ath_rate/sample/tx_schedules.h, a lot of comparisons of floating > >> > points are happening ("=="). is there a better way to deal with this? > >> > >> as opposed to (abs(a-b) < tolerance)? > > > > fabs(3) actually, or some other way, e.g. described in: > > I thought from the context it was fairly clear that the appropriate > XabsY variant had to be used without me being unnecessarily verbose in > mentioning fabs(), and its fabsl() and fabsf() friends?.. i sorry. since sys/dev/ath/ath_rate/sample/tx_schedules.h also handles a lot of integer values, i thought you referred to abs(3), because you saw also some issues with the integer computations in that file. so i thought you were referring to yet another issue in that file. cheers. alex > > > Cheers, > > -- > Igor ;-)