From owner-freebsd-standards@FreeBSD.ORG Mon Jun 7 22:10:34 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 79BF916A4CE; Mon, 7 Jun 2004 22:10:34 +0000 (GMT) Received: from VARK.homeunix.com (ar59.lsanca2-4.27.98.47.lsanca2.dsl-verizon.net [4.27.98.47]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2514C43D5C; Mon, 7 Jun 2004 22:10:34 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.11/8.12.10) with ESMTP id i576chbJ013362; Sun, 6 Jun 2004 23:38:43 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.11/8.12.10/Submit) id i576ch2H013361; Sun, 6 Jun 2004 23:38:43 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Sun, 6 Jun 2004 23:38:43 -0700 From: David Schultz To: "Steven G. Kargl" Message-ID: <20040607063843.GB13248@VARK.homeunix.com> Mail-Followup-To: "Steven G. Kargl" , FreeBSD-gnats-submit@FreeBSD.ORG, freebsd-standards@FreeBSD.ORG References: <20040605224915.GA3306@VARK.homeunix.com> <200406070128.i571SNuN068542@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200406070128.i571SNuN068542@troutmask.apl.washington.edu> cc: FreeBSD-gnats-submit@FreeBSD.ORG cc: freebsd-standards@FreeBSD.ORG Subject: Re: standards/59797: Implement C99's round[f]() math fucntions X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2004 22:10:34 -0000 On Sun, Jun 06, 2004, Steven G. Kargl wrote: > I would have to go back and review the PR for all the discussion, > but I thought bde had proposed using rint(3) with an appropriate > rounding mode. Anyway, whatever you decide to do is fine with > me. I found that setting the rounding mode and calling rint(3) is significantly slower on x87, and that's not counting the special handling for the halfway cases. The bit-fiddling approach is a little bit faster than yours (I compared against ceil()), but it's much harder to maintain. Consider that rintf() still has bugs, and it has been around for over a decade! > I looked at the glibc implementation of round(). It does > bit twiddling, but I would definitely recommend not using > the glibc version because of licensing and possible copyright > infringement concerns [hiint compare glibc's round() with > fdlibm's ceil()]. Hmmm...the glibc implementation does indeed appear to be plagiarized. Perhaps someone should let the glibc folks know.