From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 26 20:53:15 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B1BBB7A0 for ; Wed, 26 Dec 2012 20:53:15 +0000 (UTC) (envelope-from cliftonr@volcano.org) Received: from hrndva-omtalb.mail.rr.com (hrndva-omtalb.mail.rr.com [71.74.56.122]) by mx1.freebsd.org (Postfix) with ESMTP id 642A48FC0C for ; Wed, 26 Dec 2012 20:53:14 +0000 (UTC) X-Authority-Analysis: v=2.0 cv=YruNtvkX c=1 sm=0 a=nLSj6wnnDCA9frvL/Tt8NQ==:17 a=3pwD0LKv0YcA:10 a=z1TLwsU0kBEA:10 a=WthmilfBrBsA:10 a=sLPLfFCmqb0A:10 a=kj9zAlcOel0A:10 a=GjEiR67sAAAA:8 a=vbqy14apGeAA:10 a=6I5d2MoRAAAA:8 a=uyavkMrdAAAA:8 a=4FFUHJPBAAAA:8 a=pGLkceISAAAA:8 a=jb__rZ8GAAAA:8 a=rduEX2khb64y_oajGF4A:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=JGX6LFFZUg8A:10 a=WglDhLyllLQA:10 a=Ke08FT2oSu0A:10 a=sHp_62vNEjwA:10 a=ldIYYFWFX0Z42rbn:21 a=j2yJN-BlOmestitc:21 a=nLSj6wnnDCA9frvL/Tt8NQ==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 70.95.171.134 Received: from [70.95.171.134] ([70.95.171.134:38530] helo=oz.volcano.org) by hrndva-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id F3/E2-23502-4B36BD05; Wed, 26 Dec 2012 20:53:08 +0000 Received: by oz.volcano.org (Postfix, from userid 1001) id 39ACF5082E; Wed, 26 Dec 2012 10:53:07 -1000 (HST) Date: Wed, 26 Dec 2012 10:53:07 -1000 From: Clifton Royston To: Eitan Adler Subject: Re: looking for someone to fix humanize_number (test cases included) Message-ID: <20121226205307.GA66528@volcano.org> Mail-Followup-To: Eitan Adler , freebsd-hackers@freebsd.org, John-Mark Gurney References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-hackers@freebsd.org, John-Mark Gurney X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2012 20:53:15 -0000 On Wed, Dec 26, 2012 at 12:00:01PM +0000, freebsd-hackers-request@freebsd.org wrote: > Date: Tue, 25 Dec 2012 14:52:09 -0500 > From: Eitan Adler > To: freebsd-hackers@freebsd.org, John-Mark Gurney > Subject: Re: looking for someone to fix humanize_number (test cases > included) > Message-ID: > > Content-Type: text/plain; charset=UTF-8 > > On 25 December 2012 14:46, Clifton Royston wrote: > >> I correct myself: the function works fine, and there are no bugs I > > could find, though it's clear the man page could emphasize the correct > > usage a bit more. > > Can you submit a diff to the man page as well? I figure if you got > confused at least 10 others got even more confused. I'd be happy to, and will do so soon. I would like to finish rereading and poking the code a little more first, so I understand and can document how scale actually works and what it's doing without "autoscale" set, which is the actual case which John's tests first brought up. Right now its results for some test cases I'm writing don't make much sense to me, particularly with HN_DIVISOR_1000. So far from find+grep under /usr/src it appears to me that every call to humanize_number() in the code base is correctly passing HN_AUTOSCALE - i.e. the ability to pass a specific scale is unused - which may be why this never came up. -- Clifton -- Clifton Royston -- cliftonr@iandicomputing.com / cliftonr@volcano.org President - I and I Computing * http://www.iandicomputing.com/ Custom programming, network design, systems and network consulting services