> On Sat, Sep 15, 2012 at 5:36 PM, Dave Angel wrote:
>> On 09/15/2012 05:28 PM, Amanda Colley wrote:
>>> Ok, I have to get input from a user ('enter a number') and then get
>>> the
>>> cube root of that number. I am having trouble with the code to get the
>>> cube root. If anyone can help me sol
> On Sat, Sep 15, 2012 at 5:36 PM, Dave Angel wrote:
>> On 09/15/2012 05:28 PM, Amanda Colley wrote:
>>> Ok, I have to get input from a user ('enter a number') and then get
>>> the
>>> cube root of that number. I am having trouble with the code to get the
>>> cube root. If anyone can help me sol
On 16/09/12 07:28, Amanda Colley wrote:
Ok, I have to get input from a user ('enter a number') and then get the
cube root of that number. I am having trouble with the code to get the
cube root. If anyone can help me solve this I would greatly appreciate it.
('enter a number')
n=number
??? cube
On Sat, Sep 15, 2012 at 5:36 PM, Dave Angel wrote:
> On 09/15/2012 05:28 PM, Amanda Colley wrote:
>> Ok, I have to get input from a user ('enter a number') and then get the
>> cube root of that number. I am having trouble with the code to get the
>> cube root. If anyone can help me solve this I
On 09/15/2012 05:28 PM, Amanda Colley wrote:
> Ok, I have to get input from a user ('enter a number') and then get the
> cube root of that number. I am having trouble with the code to get the
> cube root. If anyone can help me solve this I would greatly appreciate it.
> ('enter a number')
> n=num
On Monday 19 January 2009 18:56, col speed wrote:
> 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
The reliable way to do this is to store a list of cubes. If the nu
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),
-Original Message-
>From: Andre Engels
>Sent: Jan 19, 2009 7:22 AM
>To: spir
>Cc: tutor@python.org
>Subject: Re: [Tutor] cube root
>
>On Mon, Jan 19, 2009 at 1:13 PM, spir wrote:
>> Do you know any common algorithm to convert decimal (in the sense of
>
On Mon, Jan 19, 2009 at 1:13 PM, spir wrote:
> Do you know any common algorithm to convert decimal (in the sense of
> fractional) decimals (in the sense of base 10 numbers) into binaries?
>
> 123.456 --> 011.bbb...
> and/or
> 123456 * 10**(-3) --> bbb... * 2**(-bbb...)
>
Hmm, Well I thought it was both, but the latter seems untrue (now that I
test a bit more)
(expt 64 (/ 1 3)) gives the value 4, but turning any of those into
floating point numbers seems to give me the infamous 3.996
thing all over again.
I was originally thinking that scheme would han
On Mon, Jan 19, 2009 at 12:11 PM, Brett Wilkins wrote:
> The only language I've run into so far (I haven't used many, mind) that
> doesn't have this issue is Scheme :)
> (Just learning it at the moment.)
It doesn't? That would surprise me. The only one that I know to do
this kind of thing correct
Do you know any common algorithm to convert decimal (in the sense of
fractional) decimals (in the sense of base 10 numbers) into binaries?
123.456 --> 011.bbb...
and/or
123456 * 10**(-3) --> bbb... * 2**(-bbb...)
How do python/C achieve that?
denis
--
la vida e es
On Mon, Jan 19, 2009 at 6:11 AM, Brett Wilkins wrote:
> The only language I've run into so far (I haven't used many, mind) that
> doesn't have this issue is Scheme :)
It doesn't have an issue with cube roots or with floating point
inaccuracies in general? If the latter, I would like to know how t
The only language I've run into so far (I haven't used many, mind) that
doesn't have this issue is Scheme :)
(Just learning it at the moment.)
Cheers,
--Brett
P.S. Forgive me if this email doesn't sort properly, sending through
webmail, as I don't have a relaying SMTP available to me currently.
Wow! Everybody jumped on the "floating point inaccuracy" topic, I'm
surprised no one tried to find out what the OP was trying to do with his
cube root solver in the first place. Of course, the first-cut approach to
solving the cube root is to raise to the 1/3 power, but this is not the only
possi
On Mon, Jan 19, 2009 at 07:41, Brett Wilkins 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
"Brett Wilkins" 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.
In fact it happens with virtually every programming language
available.
The problem traces back to the way that comp
On Mon, Jan 19, 2009 at 12:11 PM, Brett Wilkins wrote:
> Hey Colin,
> What you're running into here is the limited accuracy of floating point
> values...
Here the Python Documentation mentioning about the inherent
limitations in dealing with floating point numbers:
http://docs.python.org/tutoria
Hey Colin,
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)
19 matches
Mail list logo