Message from discussion itoc function - can it be simplified?
Received: by 10.68.129.169 with SMTP id nx9mr2967716pbb.2.1333847614836;
Sat, 07 Apr 2012 18:13:34 -0700 (PDT)
From: glen herrmannsfeldt <g...@ugcs.caltech.edu>
Subject: Re: itoc function - can it be simplified?
Date: Sun, 8 Apr 2012 01:13:29 +0000 (UTC)
Organization: Aioe.org NNTP Server
References: <9to08uFt8aU1@mid.individual.net> <UyRfr.5460$%E2.firstname.lastname@example.org> <email@example.com>
User-Agent: tin/1.9.6-20100522 ("Lochruan") (UNIX) (Linux/2.6.32-5-amd64 (x86_64))
X-Notice: Filtered by postfilter v. 0.8.2
> The OP was concerned with conversion integer values, not
> I have seen the function you describe referred to as logd,
> I assume in analogy to the IEEE function logb. The analogy
> is not exact. I have seen such functions used in the
> implementation of the G edit descriptor, where it almost
> always causes trouble. The problem is that it does not
> take rounding into account.
I have seen many times the suggestiong of using LOG10(FLOAT(n))
to find the appropriate power of 10 for integers. I suspect that
rounding could cause problems there, though I don't know of
any actual implementations.
> I know of one implementation
> that would print a field of asterisks for values close to
> but less than powers of ten, because it did not account for