From owner-freebsd-standards@FreeBSD.ORG Sat Jul 23 02:10:20 2005 Return-Path: X-Original-To: freebsd-standards@hub.freebsd.org Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C63016A41F for ; Sat, 23 Jul 2005 02:10:20 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E57E43D45 for ; Sat, 23 Jul 2005 02:10:20 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j6N2AJAD062458 for ; Sat, 23 Jul 2005 02:10:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j6N2AJ2S062457; Sat, 23 Jul 2005 02:10:19 GMT (envelope-from gnats) Date: Sat, 23 Jul 2005 02:10:19 GMT Message-Id: <200507230210.j6N2AJ2S062457@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: "Steven G. Kargl" Cc: Subject: Re: standards/83845: [ patch ] add log2() and log2f() support for libm X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Steven G. Kargl" List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2005 02:10:20 -0000 The following reply was made to PR standards/83845; it has been noted by GNATS. From: "Steven G. Kargl" To: bug-followup@FreeBSD.org, bogorodskiy@gmail.com Cc: Subject: Re: standards/83845: [ patch ] add log2() and log2f() support for libm Date: Fri, 22 Jul 2005 19:02:15 -0700 See standards/82654. I have implementations for several C99 long double math functions, and in the process I implemented log2 and logf. I also wrote or edited the man pages. IMHO, for log2[fl], we want to use frexp[fl] to break x into x = f * 2**n where f is in the range [0.5,1). We then have log2(x) = n + log2(f). We can now either evaluate log2(f) as log(f)/log(2) or directly use a polynomial approximation. -- steve