> Hi!
>
> I am using rational numbers from the gmpy module and I find that creating
> one in Python using
>
>>>> mpq(3,4)
>
> is rather clumsy. Clearly, minimal representation of this rational number
> is
>
>3/4
>
> but in Python this expres
On 2007-02-23 16:35, Martin Manns wrote:
> Hi,
>
> I am starting to use rationals and since I found no batteries included,
> I tried out the mxNumber package.
>
> However, I get strange warnings on comparison operations
> (which however seem to yield correct results):
>
> ---
> $ python
> Python
[EMAIL PROTECTED] wrote:
> On Feb 25, 3:09 pm, Fernando Perez <[EMAIL PROTECTED]> wrote:
>> Alex, have you had a look at SAGE?
>>
>> http://modular.math.washington.edu/sage/
>>
>> it uses GMP extensively, so they've had to patch it to work around these
>> issues. You can look at the SAGE release
On Feb 25, 3:09 pm, Fernando Perez <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > gmpy itself is or should be pretty trivial to build on any platform
> > (and I'll always happily accept any fixes that make it better on any
> > specific platform, since it's easy to make them conditional s
En Sat, 24 Feb 2007 01:42:00 -0300, Martin Manns <[EMAIL PROTECTED]> escribió:
> On Fri, 23 Feb 2007 20:20:12 -0300
> "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
>
>> mx.Number.Rational is horribly broken. They break this rule:
>> a==b => hash(a)==hash(b)
>> so they can'b be used as dictionary
[EMAIL PROTECTED] wrote:
> gmpy itself is or should be pretty trivial to build on any platform
> (and I'll always happily accept any fixes that make it better on any
> specific platform, since it's easy to make them conditional so they'll
> apply to that platform only), but the underlying GMP is
On Feb 24, 12:25 am, Toby A Inkster <[EMAIL PROTECTED]>
wrote:
> aleaxit wrote:
> > If anybody who has easy access to Microsoft's MSVC++.NET (and is willing
> > to try building GMP 4.2 with/for it), or a PPC Mac with XCode installed
> > (possibly with MacOSX 10.3...)
>
> I'm writing this message on
aleaxit wrote:
> If anybody who has easy access to Microsoft's MSVC++.NET (and is willing
> to try building GMP 4.2 with/for it), or a PPC Mac with XCode installed
> (possibly with MacOSX 10.3...)
I'm writing this message on a MacOS 10.3.9 box with Xcode 1.5 (gcc 3.3)
installed. If you tell me ho
On 23 Feb 2007 22:19:30 -0800
[EMAIL PROTECTED] wrote:
> > Looks pretty much the same as mx.Number
> >
> > Does this warning come up from gmp? Do I have to compile it with
> > different flags?
> > Or do both wrappers use the same code?
> >
> > I would like to encourage the python community (i.e. t
> Looks pretty much the same as mx.Number
>
> Does this warning come up from gmp? Do I have to compile it with
> different flags?
> Or do both wrappers use the same code?
>
> I would like to encourage the python community (i.e. the guys
> maintaining the python docs) to point out a recommended rati
On Fri, 23 Feb 2007 20:20:12 -0300
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> En Fri, 23 Feb 2007 12:35:19 -0300, Martin Manns <[EMAIL PROTECTED]>
> escribió:
>
> > I am starting to use rationals and since I found no batteries
> > included, I tried out the mxNumber package.
> >
> > However,
On Feb 23, 3:44 pm, [EMAIL PROTECTED] wrote:
...
> I can keep building gmpy for Windows. I actually use MINGW since
> getting GMP compiled under MSVC is "challanging". I should be able to
> build new binaries for Windows this weekend. And I would be happy to
> point everyone to a real release.
On Feb 23, 3:27 pm, [EMAIL PROTECTED] wrote:
> On Feb 23, 12:00 pm, [EMAIL PROTECTED] wrote:
>...
>
> > > > + gmpy is looking pretty unmaintained (dead) to me (newest update of
> > > > cvs 10 months ago).
>
> > I worked withAlex Martelli(gmpy's maintainer) to fix a bug found by
> > mensanator.
On Feb 23, 2:52 pm, [EMAIL PROTECTED] wrote:
> > Am I hallucinating? Didn't I see at least some version
> > of gmpy for Python 2.5 on SourceForge awhile back?
> > I distinctly remember thinking that I don't have to
> > direct people to your site, but SourceForge is not
> > showing anything beyond v
On Feb 23, 12:00 pm, [EMAIL PROTECTED] wrote:
...
> > > + gmpy is looking pretty unmaintained (dead) to me (newest update of
> > > cvs 10 months ago).
>
> I worked withAlex Martelli(gmpy's maintainer) to fix a bug found by
> mensanator. With Alex's permission, I released it as gmpy 1.04a. Alex
>
En Fri, 23 Feb 2007 12:35:19 -0300, Martin Manns <[EMAIL PROTECTED]> escribió:
> I am starting to use rationals and since I found no batteries included,
> I tried out the mxNumber package.
>
> However, I get strange warnings on comparison operations
> (which however seem to yield correct results):
> Am I hallucinating? Didn't I see at least some version
> of gmpy for Python 2.5 on SourceForge awhile back?
> I distinctly remember thinking that I don't have to
> direct people to your site, but SourceForge is not
> showing anything beyond vesion 1.01 for Python 2.4.
Alex released versions 1.0
On Feb 23, 2:00 pm, [EMAIL PROTECTED] wrote:
> On Feb 23, 10:34 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On Feb 23, 10:39 am, Martin Manns <[EMAIL PROTECTED]> wrote:
>
> > > On Fri, 23 Feb 2007 09:52:06 -0600
>
> > > Larry Bates <[EMAIL PROTECTED]> wrote:
> > > > I quick sea
On 23 Feb 2007 12:00:10 -0800
[EMAIL PROTECTED] wrote:
>
> I worked with Alex Martelli (gmpy's maintainer) to fix a bug found by
> mensanator. With Alex's permission, I released it as gmpy 1.04a. Alex
> has not updated cvs with the fix.
>
> gmpy 1.04a compiles cleanly with the latest releases of
On Feb 23, 10:34 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> On Feb 23, 10:39 am, Martin Manns <[EMAIL PROTECTED]> wrote:
>
> > On Fri, 23 Feb 2007 09:52:06 -0600
>
> > Larry Bates <[EMAIL PROTECTED]> wrote:
> > > I quick search of Google turned up:
>
> > >http://books.google.com/books?id=
In <[EMAIL PROTECTED]>, Martin Manns wrote:
> + gmpy is looking pretty unmaintained (dead) to me (newest update of
> cvs 10 months ago).
What CSV activities do you expect? This package seems to be pretty
stable. As long as there is no bug or incompatible changes in the
underlying library I woul
On Feb 23, 10:39 am, Martin Manns <[EMAIL PROTECTED]> wrote:
> On Fri, 23 Feb 2007 09:52:06 -0600
>
> Larry Bates <[EMAIL PROTECTED]> wrote:
> > I quick search of Google turned up:
>
> >http://books.google.com/books?id=1Shx_VXS6ioC&pg=PA625&lpg=PA625&dq=p...
> >http://calcrpnpy.sourceforge.net/clnu
Martin Manns:
> + gmpy is looking pretty unmaintained (dead) to me (newest update of
> cvs 10 months ago).
I have used it on Py2.5, so it seems to work anyway, and it's fast
enough for my purposes. And probably soon some alex-shaped life will
show up elsewhere.
Bye,
bearophile
--
http://mail.py
On Fri, 23 Feb 2007 11:39:11 -0500
Martin Manns <[EMAIL PROTECTED]> wrote:
> + boost indeed is a quite nice C++ library. However, I fear that I
> would end up writing the python wrappers for operators (+ - * / min
> max cmp etc.) myself. I would like to avoid this since these operators
> should wo
On Fri, 23 Feb 2007 09:52:06 -0600
Larry Bates <[EMAIL PROTECTED]> wrote:
> I quick search of Google turned up:
>
> http://books.google.com/books?id=1Shx_VXS6ioC&pg=PA625&lpg=PA625&dq=python+rational+number+library&source=web&ots=BA8_4EXdQ4&sig=aDEnYA99ssKe7PSweVNyi8cS2eg
> http://calcrpnpy.source
Martin Manns wrote:
> Hi,
>
> I am starting to use rationals and since I found no batteries included,
> I tried out the mxNumber package.
>
> However, I get strange warnings on comparison operations
> (which however seem to yield correct results):
>
> ---
> $ python
> Python 2.4.3 (#1, Jan 15 20
Hi,
I am starting to use rationals and since I found no batteries included,
I tried out the mxNumber package.
However, I get strange warnings on comparison operations
(which however seem to yield correct results):
---
$ python
Python 2.4.3 (#1, Jan 15 2007, 15:46:19)
[GCC 4.1.1 (Gentoo 4.1.1-r3
In article <[EMAIL PROTECTED]>,
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes:
|>
|> Ok I will throw in a skewed ball at this point - use integer arithmetic,
|> and work in tenths of cents or pennies or whatever, and don't be too
|> lazy to do your own print formatting...
If anyone is interes
In article <[EMAIL PROTECTED]>,
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes:
|>
|> > Financial calculations need decimal FIXED-point, with a precisely
|> > specified precision. It is claimed that decimal FLOATING-point
|> > helps with providing that, but that claim is extremely dubious.
|> >
From: "Nick Maclaren" <[EMAIL PROTECTED]> wrote:
> Financial calculations need decimal FIXED-point, with a precisely
> specified precision. It is claimed that decimal FLOATING-point
> helps with providing that, but that claim is extremely dubious.
> I can explain the problem in as much detail as
In article <[EMAIL PROTECTED]>,
"Simon Brunning" <[EMAIL PROTECTED]> writes:
|> >
|> > Financial calculations need decimal FIXED-point, with a precisely
|> > specified precision. It is claimed that decimal FLOATING-point
|> > helps with providing that, but that claim is extremely dubious.
|> > I
In article <[EMAIL PROTECTED]>,
Steven D'Aprano <[EMAIL PROTECTED]> writes:
|> >
|> > Some of the algebraic languages. (2/3)^(1/5) is held as such and
|> > manipulated appropriately.
|> >
|> > Yes, I know that's "cheating" :-)
|>
|> I see your smiley, and I still don't understand. Why on earth
On Fri, 12 Jan 2007 17:15:56 +, Nick Maclaren wrote:
> In article <[EMAIL PROTECTED]>,
> Facundo Batista <[EMAIL PROTECTED]> writes:
> |> Noud Aldenhoven wrote:
> |>
> |> > There are a (small) couple of other issues where rational numbers could
>
On Fri, 12 Jan 2007 20:07:04 +, Simon Brunning wrote:
> On 1/12/07, Thomas Ploch <[EMAIL PROTECTED]> wrote:
>> Do not forget:
>>
>> - Time
>> - Personal Data (like birthdays, age)
>
> The datetime module has perfectly good classes for holding date and
> time values, and age sounds like an int
On 1/12/07, Thomas Ploch <[EMAIL PROTECTED]> wrote:
> Do not forget:
>
> - Time
> - Personal Data (like birthdays, age)
The datetime module has perfectly good classes for holding date and
time values, and age sounds like an integer to me.
--
Cheers,
Simon B
[EMAIL PROTECTED]
--
http://mail.pyth
On 12 Jan 2007 19:41:52 GMT, Nick Maclaren <[EMAIL PROTECTED]> wrote:
> Sigh. I was hoping not to have that myth perpetrated again.
>
> Financial calculations need decimal FIXED-point, with a precisely
> specified precision. It is claimed that decimal FLOATING-point
> helps with providing that, b
Simon Brunning schrieb:
> On 12 Jan 2007 15:55:39 GMT, Nick Maclaren <[EMAIL PROTECTED]> wrote:
>> In article <[EMAIL PROTECTED]>,
>> Carsten Haese <[EMAIL PROTECTED]> writes:
>> |> but there are more use
>> |> cases for Decimal than for Rational.
>>
>> That is dubious, but let's not start that one
In article <[EMAIL PROTECTED]>,
"Simon Brunning" <[EMAIL PROTECTED]> writes:
|>
|> > |> but there are more use
|> > |> cases for Decimal than for Rational.
|> >
|> > That is dubious, but let's not start that one again.
|>
|> Decimals are good for holding financial values. There's a whole lot of
|
On 12 Jan 2007 15:55:39 GMT, Nick Maclaren <[EMAIL PROTECTED]> wrote:
>
> In article <[EMAIL PROTECTED]>,
> Carsten Haese <[EMAIL PROTECTED]> writes:
> |> but there are more use
> |> cases for Decimal than for Rational.
>
> That is dubious, but let's not start that one again.
Decimals are good for
On 1/12/07, Facundo Batista <[EMAIL PROTECTED]> wrote:
Noud Aldenhoven wrote:
> There are a (small) couple of other issues where rational numbers could
be
> handy. That's because rational numbers are exact, irrational numbers (in
> python) aren't. But these issues are
In article <[EMAIL PROTECTED]>,
Facundo Batista <[EMAIL PROTECTED]> writes:
|> Noud Aldenhoven wrote:
|>
|> > There are a (small) couple of other issues where rational numbers could be
|> > handy. That's because rational numbers are exact, irrational numbers
Noud Aldenhoven wrote:
> There are a (small) couple of other issues where rational numbers could be
> handy. That's because rational numbers are exact, irrational numbers (in
> python) aren't. But these issues are probably too mathematical to be used in
For the sake of me
In article <[EMAIL PROTECTED]>,
Carsten Haese <[EMAIL PROTECTED]> writes:
|>
|> Ah, so now you're putting words in the BDFL's mouth. ;)
|>
|> The pronouncement does say "The needs outlined in the rationale section
|> have been addressed to some extent by the acceptance of PEP 327 for
|> decimal
> Facundo Batista <[EMAIL PROTECTED]> writes:
> |> > |> Python does not have rational numbers.
> |> > |>
> |> > |> There's a (rejected) PEP about this, PEP-239:
> |> > |>
> |> > |> http://www.python.org/dev/peps/pep-0239/
> |> &g
:
|> > |>
|> > |> > When I was programming in a mathematical project I began to wonder if
python
|> > |> > supports rational numbers[1]. In a language like magma[2] it's not
such a
|> > |> > problem. Does python supports something simular?
|>
On Thu, 2007-01-11 at 23:47 +, Nick Maclaren wrote:
> In article <[EMAIL PROTECTED]>,
> Facundo Batista <[EMAIL PROTECTED]> writes:
> |> Noud Aldenhoven wrote:
> |>
> |> > When I was programming in a mathematical project I began to wonder if
> python
In article <[EMAIL PROTECTED]>,
Facundo Batista <[EMAIL PROTECTED]> writes:
|> Noud Aldenhoven wrote:
|>
|> > When I was programming in a mathematical project I began to wonder if
python
|> > supports rational numbers[1]. In a language like magma[2] it's n
Noud Aldenhoven wrote:
> I'm a mathematician (in learning, with a bad feeling for English) and
> don't trust irrational numbers in programming languages.
You may want to look at SAGE. It provides a ton of good mathematical code.
http://sage.scipy.org/sage/
--
Robert Kern
"I have come to bel
On 1/11/07, Facundo Batista <[EMAIL PROTECTED]> wrote:
Python does not have rational numbers.
Ah, oke. Thank you, it seems I have enough information why they aren't
included in the core.
Question: Why do you say that it's a problem?
Well... Perhaps I word it wrong. I
Noud Aldenhoven wrote:
> When I was programming in a mathematical project I began to wonder if python
> supports rational numbers[1]. In a language like magma[2] it's not such a
> problem. Does python supports something simular?
Python does not have rational numbers.
There'
Hello,
When I was programming in a mathematical project I began to wonder if python
supports rational numbers[1]. In a language like magma[2] it's not such a
problem. Does python supports something simular?
Greetings,
Noud Aldenhoven
--
<:3 )~
[1] http://en.wikipedia.org/wiki/Rationa
On Tue, 2006-01-17 at 11:22, Paul Rubin wrote:
> Schüle Daniel <[EMAIL PROTECTED]> writes:
> > does anybody know modules which make rational numbers available?
>
> Try gmpy.mpq (google for gmpy).
>
> > and are there considerations to add them to the core, like
Schüle Daniel <[EMAIL PROTECTED]> writes:
> does anybody know modules which make rational numbers available?
> and are there considerations to add them to the core, like
> complex numbers (maybe in Python 3)
I think it's not likely. In Scheme, (/ 5 2) is the rational number
5
Schüle Daniel <[EMAIL PROTECTED]> writes:
> does anybody know modules which make rational numbers available?
Try gmpy.mpq (google for gmpy).
> and are there considerations to add them to the core, like
> complex numbers (maybe in Python 3)
I don't think it's been
Hello NG,
recently I was using Scheme and Ruby and was really nicely surprised
to find there support for the computing with rational numbers
for example this how it works in Ruby
mond:/pool/PROG/ruby # irb
irb(main):001:0>
irb(main):002:0* require "mathn"
=> true
irb(main):003
Raymond Hettinger wrote:
> > > For a simple example, convert both 10247448370872321 and
> > > 10247448370872319 from base ten to 4 digits of hex. The calculations
> > > need to be carried out to 15 places of hex (or 17 places of decimal)
> > > just to determine whether the fourth hex digit is a
> > For a simple example, convert both 10247448370872321 and
> > 10247448370872319 from base ten to 4 digits of hex. The calculations
> > need to be carried out to 15 places of hex (or 17 places of decimal)
> > just to determine whether the fourth hex digit is a 7 or 8:
> >
> > >>> hex(1024744
Raymond Hettinger wrote:
> [Terry Hancock]
> > > Needless to say, the conventional floating point numbers in Python
> > > are actually stored as *binary*, which is why there is a "decimal"
> > > module (which is new).
> > >
> > > If you're going to be converting between bases anyway, it probably
[Terry Hancock]
> > Needless to say, the conventional floating point numbers in Python
> > are actually stored as *binary*, which is why there is a "decimal"
> > module (which is new).
> >
> > If you're going to be converting between bases anyway, it probably
> > makes little difference whether you
es. It aims to take any of whole
> numbers (python ints, longs, or Decimals), rational numbers (n / m n,
> m whole) and floating points (the best I can do for reals), and
> convert them to any base between 2 and 36, to desired precision.
...
> I've discovered empirically that I ha
mbers (python ints, longs, or Decimals), rational numbers (n / m n,
>>m whole) and floating points (the best I can do for reals), and
>>convert them to any base between 2 and 36, to desired precision.
Thanks to Terry and mensanator for the replies.
To consolidate, I respond to Ter
bases. It aims to take any of whole
> numbers (python ints, longs, or Decimals), rational numbers (n / m n,
> m whole) and floating points (the best I can do for reals), and
> convert them to any base between 2 and 36, to desired precision.
>
> I'm pretty close but I know I am not
On Monday 04 July 2005 06:11 am, Brian van den Broek wrote:
> As a self-directed learning exercise I've been working on a script to
> convert numbers to arbitrary bases. It aims to take any of whole
> numbers (python ints, longs, or Decimals), rational numbers (n / m n,
> m wh
longs, or Decimals), rational numbers (n / m n,
m whole) and floating points (the best I can do for reals), and
convert them to any base between 2 and 36, to desired precision.
I'm pretty close but I know I am not handling the precision quite
right. Nothing other than understanding hangs
64 matches
Mail list logo