Date: Fri, 28 Dec 2012 10:06:27 -1000 From: Clifton Royston <cliftonr@volcano.org> To: Eitan Adler <lists@eitanadler.com>, freebsd-hackers@freebsd.org, John-Mark Gurney <jmg@funkthat.com> Subject: Re: looking for someone to fix humanize_number (test cases included) Message-ID: <20121228200627.GA91874@volcano.org> In-Reply-To: <20121228002433.GA80168@volcano.org> References: <mailman.7.1356523201.47461.freebsd-hackers@freebsd.org> <20121226205307.GA66528@volcano.org> <20121227183136.GA77509@volcano.org> <20121228002433.GA80168@volcano.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121228200627.GA91874>