Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Dec 2011 00:06:44 +0000
From:      Igor Mozolevsky <mozolevsky@gmail.com>
To:        Alexander Best <arundel@freebsd.org>
Cc:        freebsd-wireless@freebsd.org
Subject:   Re: comparing floating points via "==" or "!="
Message-ID:  <CADWvR2irEU0ANHNG4mvC1voVP6Y3YMTQxs5d35o5SbBTJ8JyfQ@mail.gmail.com>
In-Reply-To: <20111201000243.GB44877@freebsd.org>
References:  <20111130224422.GA36424@freebsd.org> <CADWvR2herXkcMaZXFKm_ALBXnVFDhRCNZ-9%2B-MwHVx5XJPG4AA@mail.gmail.com> <20111201000243.GB44877@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1 December 2011 00:02, Alexander Best <arundel@freebsd.org> wrote:
> On Wed Nov 30 11, Igor Mozolevsky wrote:
>> On 30 November 2011 22:44, Alexander Best <arundel@freebsd.org> 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?..


Cheers,

--
Igor ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADWvR2irEU0ANHNG4mvC1voVP6Y3YMTQxs5d35o5SbBTJ8JyfQ>