On 20 Nov, 06:01, srinivasan srinivas <[EMAIL PROTECTED]> wrote:
> Yes it works for most of the cases. But it doesn't for the following case:
>
> >>> str(abs(int(1234567.89)-1234567.89))
>
> '0.88999898'
Well, that is 0.89 or about as near to it as the calculation can
represent. Like other nu
TED]>
> To: srinivasan srinivas <[EMAIL PROTECTED]>
> Cc: Jeremiah Dodds <[EMAIL PROTECTED]>; python-list@python.org
> Sent: Wednesday, 19 November, 2008 7:33:46 PM
> Subject: Re: Getting fractional part from a float without using string
> operations
>
> sriniva
CTED]>
Cc: Jeremiah Dodds <[EMAIL PROTECTED]>; python-list@python.org
Sent: Wednesday, 19 November, 2008 7:33:46 PM
Subject: Re: Getting fractional part from a float without using string
operations
srinivasan srinivas wrote:
> Yes. But it didn't give only the expected decima
On Nov 20, 3:38 am, "Blind Anagram" <[EMAIL PROTECTED]> wrote:
> "MRAB" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
> On Nov 19, 1:44 pm, John Machin <[EMAIL PROTECTED]> wrote:
>
> > On Nov 20, 12:35 am, srinivasan srinivas <[EMAIL PROTECTED]>
> > wrote:
> >
>
> > | >>> import
"MRAB" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Nov 19, 1:44 pm, John Machin <[EMAIL PROTECTED]> wrote:
On Nov 20, 12:35 am, srinivasan srinivas <[EMAIL PROTECTED]>
wrote:
| >>> import math
| >>> num = 123.4567
| >>> math.modf(num)
| (0.456699789, 123.0)
def fra
srinivasan srinivas wrote:
Yes. But it didn't give only the expected decimals.
For ex:
>>> a = 1.23
>>> abs(int(a) -a)
0.22998
I would like to get the result '0.23' only.
well, thats what get stored internally - there
is no way around it if you are using floating
point numbers:
On Nov 19, 1:44 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On Nov 20, 12:35 am, srinivasan srinivas <[EMAIL PROTECTED]>
> wrote:
>
>
> | >>> import math
> | >>> num = 123.4567
> | >>> math.modf(num)
> | (0.456699789, 123.0)
def frac(n):
return n - int(n)
--
http://mail.python.org/ma
hon-list@python.org
Sent: Wednesday, 19 November, 2008 7:14:17 PM
Subject: Re: Getting fractional part from a float without using string
operations
On Wed, Nov 19, 2008 at 8:35 AM, srinivasan srinivas <[EMAIL PROTECTED]> wrote:
Thanks,
Srini
Add more friends to your messenger and en
On Nov 20, 12:35 am, srinivasan srinivas <[EMAIL PROTECTED]>
wrote:
| >>> import math
| >>> num = 123.4567
| >>> math.modf(num)
| (0.456699789, 123.0)
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Nov 19, 2008 at 8:35 AM, srinivasan srinivas <
[EMAIL PROTECTED]> wrote:
> Thanks,
> Srini
>
>
> Add more friends to your messenger and enjoy! Go to
> http://messenger.yahoo.com/invite/
> --
> http://mail.python.org/mailman/listinfo/python-list
>
x = 2.99340584
y = abs(int(x) - x)
y
Thanks,
Srini
Add more friends to your messenger and enjoy! Go to
http://messenger.yahoo.com/invite/
--
http://mail.python.org/mailman/listinfo/python-list
On 22 jul, 01:39, "David Wahler" <[EMAIL PROTECTED]> wrote:
> On Mon, Jul 21, 2008 at 10:31 PM, youtoo <[EMAIL PROTECTED]> wrote:
> > It has been extensively discussed the time complexity (quadratic) of
> > string concatenation (due to string's immutability).
>
> Actually, it is roughly linear, at
youtoo wrote:
It has been extensively discussed the time complexity (quadratic) of
string concatenation (due to string's immutability).
But what is:
== the time complexity of string indexing? Is it constant?
== the time complexity of string slicing? Is it O(K) with K the
slice's length?
How a
On Mon, Jul 21, 2008 at 10:31 PM, youtoo <[EMAIL PROTECTED]> wrote:
> It has been extensively discussed the time complexity (quadratic) of
> string concatenation (due to string's immutability).
Actually, it is roughly linear, at least for reasonable string lengths:
$ python -V
Python 2.5.2
$ pyth
It has been extensively discussed the time complexity (quadratic) of
string concatenation (due to string's immutability).
But what is:
== the time complexity of string indexing? Is it constant?
== the time complexity of string slicing? Is it O(K) with K the
slice's length?
How are strings stored
On Wednesday 01 December 2004 04:20 pm, Anoop Rajendra wrote:
> os.execvp("condor_q",["condor_q","-l","-constraint",'"ProjectId==\\\"anoopr_samadams.fnal.gov_161903_30209\\\""'])
>
> doesnt work. Its definately a problem with one of the million
> backslashes and quotes present, but I'm not able to
Anoop Rajendra wrote:
Hi. I'm trying to resolve an issue with strings.
The command(inclusive of the back-slashes)
condor_q -l -constraint "ProjectId==\"anoopr_samadams.fnal.gov_161903_30209\""
is the only way the command returns the right result.
I'm trying to run this command from inside a python
Hi. I'm trying to resolve an issue with strings.
The command(inclusive of the back-slashes)
condor_q -l -constraint "ProjectId==\"anoopr_samadams.fnal.gov_161903_30209\""
is the only way the command returns the right result.
I'm trying to run this command from inside a python program.
The way I
18 matches
Mail list logo