Re: Using fractions instead of floats

2007-10-02 Thread richyjsm
On Oct 2, 5:27 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > But it is still wrong to say "0.6 is definitely not the same as 3/5". Out of context, I'd certainly agree. But from the context, I assumed it was clear that the 0.6 was a Python float. I probably should have made this clearer.

Re: Using fractions instead of floats

2007-10-01 Thread richyjsm
On Oct 1, 9:03 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Oct 1, 7:20 pm, [EMAIL PROTECTED] wrote: > > > On Oct 1, 8:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > > >>> mpq(1,3)+0.6 > > > mpq(14,15) > > > Golly! That's quite impressive. And more than a little bit magic

Re: Using fractions instead of floats

2007-10-01 Thread richyjsm
On Oct 1, 8:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > >>> mpq(1,3)+0.6 > mpq(14,15) Golly! That's quite impressive. And more than a little bit magic as well, since 0.6 is definitely not the same as 3/5. How on earth does this work? Richard -- http://mail.python.org/mailman/list

Re: Nested For and While Statements

2007-09-24 Thread richyjsm
On Sep 24, 4:52 pm, [EMAIL PROTECTED] wrote: > Here is my code, in the hopes that there is a reason why it isn't > running. Thanks guys. [code snipped] You're missing the closing parenthesis on the last line of the inner for loop. Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread richyjsm
On Sep 22, 9:10 pm, Paul Rubin wrote: > Certainly xgcd should be in the math library or somewhere similar. It does feel odd to have modular exponentiation in the core but no other number-theoretic stuff in core+libraries. Perhaps a proposal on python-ideas is in order..

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread richyjsm
On Sep 22, 7:50 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Everybody forgets that pow can take three arguments, except of course for > those who use that functionality and would be mighty peeved if it went > away. And who is it who uses this functionality? It's useful in

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread richyjsm
On Sep 22, 7:04 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Sat, 22 Sep 2007 21:17:38 +, Bryan Olson wrote: > > The operator module offers pow(). Is there any good reason for > > pow() as a built-in? > > The `operator.pow()` is just the function for ``**``, it lacks the > opti

Re: Getting rid of bitwise operators in Python 3?

2007-09-22 Thread richyjsm
On Sep 22, 11:13 am, Bryan Olson <[EMAIL PROTECTED]> wrote: > One surprising result was that more of the Python > programmers surveyed use bitwise operators than are aware > of the exponentiation operator, which C does not offer. On that subject, I'd suggest that the pow() builtin (not the ** oper

Re: So what exactly is a complex number?

2007-09-03 Thread richyjsm
On Sep 2, 6:13 am, Grzegorz S odkowicz <[EMAIL PROTECTED]> wrote: > In fact, a proper vector in physics has 4 features: point of > application, magnitude, direction and sense. so whats the "point of application" of the sum of two vectors? Do tell. -- http://mail.python.org/mailman/listinfo/py

what's the point of pow()?

2007-08-08 Thread richyjsm
it's a serious question: why does the builtin pow function exist? for two argument pow we've got **. there's no add() for + or mul() for * and three argument pow-with-modulo seems like specilaist usage that belongs in the standard lib, not in the core. I know about crypto and number theory

Re: Proposal: s1.intersects(s2)

2007-07-04 Thread richyjsm
On Jul 4, 8:14 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > However, there's a very subtle flaw in the idea. While "the intersection" > of two sets is well-defined, "these two sets intersect" is (surprisingly!) > _not_ well-defined. Poppycock! It's perfectly well defined: two sets intersect