[Tutor] cube root
col speed
ajarncolin at gmail.com
Tue Jan 20 01:56:39 CET 2009
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 <vginer at gmail.com>
>
>
>
>
> On Mon, Jan 19, 2009 at 07:41, Brett Wilkins <lupin at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090120/16b9ce25/attachment.htm>
More information about the Tutor
mailing list