Wow! I seem to have caused a great deal of comments!
I actually am looking to see if a number is a "perfect cube". I will try out
all the suggestions.
Thanks a lot.
Colin
P.S.
I have a small programme that changes decimal to binary (I don't know if it
can be changed to work with fractions or not), maybe it will help.

def dec2bin(dec):
    bin = ''
    while dec > 0:
        bin = str(dec & 1) + bin
        dec >>= 1
    return bin

2009/1/19 Vicent <vgi...@gmail.com>

>
>
>
>
> On Mon, Jan 19, 2009 at 07:41, Brett Wilkins <lu...@orcon.net.nz> wrote:
>
>>
>> What you're running into here is the limited accuracy of floating point
>> values...
>> You'll likely find this happens a lot in python.. CPython, at least. (I
>> know, as I do)
>> I'm not sure, as I've never used it... but perhaps Numeric/Numpy handle
>> this kinda stuff better (for accuracy's sake)
>>
>>
> Maybe this issue can be overcome by using symbolic notation when possible
> (maybe by using SymPy)? Has anyone any experience with this?
>
> --
> Vicent
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to