How to detect a double's significant digits

Grant Edwards grante at visi.com
Thu May 5 14:43:51 EDT 2005


On 2005-05-05, mrstephengross <mrstephengross at hotmail.com> wrote:
>>But, assuming you have your numbers as strings, I would suggest
> looking
> at str.split() and len().
>
> Well, the numbers are in fact stored as numbers,

Then your question is in fact meaningless.  The related
question that can be answered is "where is the least
significant '1' bit in the IEEE representation".  If that's
useful information, the struct module will help you find it.

> so string processing won't work.

That's the only way to answer the question you asked.

>>I'd give you an example, but this sounds kinda like a homework
>> assignment.
>
> The task may sound like it comes from class, but I can assure
> you that I am indeed a professional developer. I'm doing some
> rather intricate text processing / rendering stuff these days,
> and C++ is unfortunately none too handy for that sort of
> thing. Unfortunately, I have to use it for the task.

-- 
Grant Edwards                   grante             Yow!  Hmmm... A hash-singer
                                  at               and a cross-eyed guy were
                               visi.com            SLEEPING on a deserted
                                                   island, when...



More information about the Python-list mailing list