[PLUG] OT: Formula For Determining # Of Digits In An Integer

William A Morita wamorita at hevanet.com
Thu Feb 17 22:18:09 UTC 2005


Jason,

A much more interesting problem is how many bits to hold a particular value:

For a given value X:  Log2(X) or Log10(X)/Log10(2) both rounded up if
fractional.

- Bill 

wamorita at hevanet.com 
Home: (503) 697-6994
Cell: (503) 260-3876

 

-----Original Message-----
From: plug-bounces at lists.pdxlinux.org
[mailto:plug-bounces at lists.pdxlinux.org] On Behalf Of Jason Van Cleve
Sent: Thursday, February 17, 2005 1:55 PM
To: plug at lists.pdxlinux.org; javamail at pjug.org; euglug-bounces at euglug.org
Subject: [PLUG] OT: Formula For Determining # Of Digits In An Integer

Hi,

I know many of you folks are advanced in mathematics.  I need a formula that
will take an integer and return the number of its digits:

3	--> 1
25	--> 2
52341	--> 5
032	--> 2 (ignore leading 0's)

Any ideas?

--Jason

--
Emacs is a great operating system.  The only thing it lacks is a good text
editor.
_______________________________________________
PLUG mailing list
PLUG at lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug





More information about the PLUG mailing list