From owner-freebsd-wireless@FreeBSD.ORG Wed Nov 30 23:21:38 2011 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA843106564A; Wed, 30 Nov 2011 23:21:38 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 891F08FC08; Wed, 30 Nov 2011 23:21:38 +0000 (UTC) Received: by ggnk5 with SMTP id k5so1868380ggn.13 for ; Wed, 30 Nov 2011 15:21:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=PhXAeATxTTihzs4ArGOVPXtT9jyu7uN+jGLcnd8dA+A=; b=h0JE7XA/q7PQgy3ICPnHJGg/ni97qbRANzpIf3wEd7lZ4epowV2lWO6E7PjEGPqQLu Gwazyd6DJWQ9FUvdiyRK/TC2FDX6iWx8ipRJO23oY0IWxsu/ZaFkoCus9eLkUzF7R/f6 liL5JkgSMUkCbeS1i/RXU1BU8Ae/yHMvDpn8k= Received: by 10.68.12.199 with SMTP id a7mr1250084pbc.58.1322693779064; Wed, 30 Nov 2011 14:56:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.48.5 with HTTP; Wed, 30 Nov 2011 14:55:38 -0800 (PST) In-Reply-To: <20111130224422.GA36424@freebsd.org> References: <20111130224422.GA36424@freebsd.org> From: Igor Mozolevsky Date: Wed, 30 Nov 2011 22:55:38 +0000 Message-ID: To: Alexander Best Content-Type: text/plain; charset=UTF-8 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: Wed, 30 Nov 2011 23:21:38 -0000 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)? Cheers, -- Igor :-)