From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 28 20:06:31 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 0BD79B24 for ; Fri, 28 Dec 2012 20:06:31 +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 B21B48FC14 for ; Fri, 28 Dec 2012 20:06:29 +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=jb__rZ8GAAAA:8 a=aFfbZGGNudtPEWjFmTMA:9 a=CjuIK1q_8ugA:10 a=sHp_62vNEjwA:10 a=Ke08FT2oSu0A:10 a=Plx_6KoHmakatvLX:21 a=lh7BmEqGAnGmqoX3: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:24748] helo=oz.volcano.org) by hrndva-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 73/A2-23502-4CBFDD05; Fri, 28 Dec 2012 20:06:29 +0000 Received: by oz.volcano.org (Postfix, from userid 1001) id EA2C65082E; Fri, 28 Dec 2012 10:06:27 -1000 (HST) Date: Fri, 28 Dec 2012 10:06:27 -1000 From: Clifton Royston To: Eitan Adler , freebsd-hackers@freebsd.org, John-Mark Gurney Subject: Re: looking for someone to fix humanize_number (test cases included) Message-ID: <20121228200627.GA91874@volcano.org> Mail-Followup-To: Eitan Adler , freebsd-hackers@freebsd.org, John-Mark Gurney References: <20121226205307.GA66528@volcano.org> <20121227183136.GA77509@volcano.org> <20121228002433.GA80168@volcano.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121228002433.GA80168@volcano.org> User-Agent: Mutt/1.4.2.3i 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: Fri, 28 Dec 2012 20:06:31 -0000 On Thu, Dec 27, 2012 at 02:24:33PM -1000, Clifton Royston wrote: > On Thu, Dec 27, 2012 at 08:31:36AM -1000, Clifton Royston wrote: > > ... > > I'll put the updated test program somewhere shortly. > > Test code and draft of revisions to function are at > > http://www.volcano.org/misc/humanize_number/ Improved revision of function, improved tests (up to 177 now), and an updated man page are now at the above URL. Of note in the latest code revision: I corrected the code to correctly scale and format values to +/- INT64_MAX (except when scale == 0); it will now handle values above 82 petabytes (INT64_MAX/100) which never worked correctly before. Invalid arguments are better detected and rejected. The tests now cover boundary cases for large number values, and have some command line options to control what subset of tests get run, initial buffer size, etc. The man page now documents correct values for the scale argument, what the output and return values are for scale == 0, when 'K' vs 'k' is used in the output, and which invalid parameters will cause an assertion, along with some changes to wording mostly relating to the 1024 vs 1000 divisor. I think I'm done playing with it now. -- 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