Since the interest is more in extended precision than in decimal
representation, there is another module that may be of interest.
http://calcrpnpy.sourceforge.net/clnum.html
It interfaces to the Class Library for Numbers (CLN) library to provide
both arbitrary precision floating point and
Neil Cerutti wrote:
Another guess could be that real numbers being closed under the
four arithmetic operations, there is no danger to accidentally
step into complex numbers. OTOH floats and rationals are two
(conflicting) ways of extending integers.
You would have to adopt a few simple
The clnum package adds rational numbers and arbitrary precision floating
point numbers in real and complex form to Python. Also provides
arbitrary precision floating point replacements for the functions in the
math and cmath standard library modules.
Home page:
The ratfun module provides classes for defining polynomial and rational
function (ratio of two polynomials) objects. These objects can be used
in arithmetic expressions and evaluated at a particular point.
Home page: http://calcrpnpy.sourceforge.net/ratfun.html
Note: If you are using
The rpncalc package adds an interactive Reverse Polish Notation (RPN)
interpreter to Python. This interpreter allows the use of Python as
an RPN calculator. You can easily switch between the RPN interpreter
and the standard Python interpreter.
Home page: http://calcrpnpy.sourceforge.net/
The clnum package adds rational numbers and arbitrary precision floating
point numbers in real and complex form to Python. Also provides
arbitrary precision floating point replacements for the functions in the
math and cmath standard library modules.
Home page:
The ratfun module provides classes for defining polynomial and rational
function (ratio of two polynomials) objects. These objects can be used
in arithmetic expressions and evaluated at a particular point.
Home page: http://calcrpnpy.sourceforge.net/ratfun.html
Note: If you are using
The rpncalc package adds an interactive Reverse Polish Notation (RPN)
interpreter to Python. This interpreter allows the use of Python as
an RPN calculator. You can easily switch between the RPN interpreter
and the standard Python interpreter.
Home page: http://calcrpnpy.sourceforge.net/
Bas wrote:
Are there any differences between this module and the one already
present in numpy?
http://www.scipy.org/doc/numpy_api_docs/numpy.lib.polynomial.html
Cheers,
Bas
Yes, there are quite a few. This module uses a multi-precision library
(clnum) to make the calculations more
The clnum package adds rational numbers and arbitrary precision floating
point numbers in real and complex form to Python. Also provides
arbitrary precision floating point replacements for the functions in the
math and cmath standard library modules.
Home page:
The clnum package adds rational numbers and arbitrary precision floating
point numbers in real and complex form to Python. Also provides
arbitrary precision floating point replacements for the functions in the
math and cmath standard library modules.
Home page:
Felipe Almeida Lessa wrote:
Em Dom, 2006-06-11 às 11:19 -0700, fl1p-fl0p escreveu:
import math
math.pow(34564323, 456356)
will give math range error.
how can i force python to process huge integers without math range
error? Any modules i can use possibly?
34564323**456356 ?
I just
K.S.Sreeram wrote:
Raymond L. Buvel wrote:
I just tried this and it is taking an extremely long time even on a fast
machine with 4 Gb of RAM. Killed it after a couple of minutes.
Thats odd.
34564323**456356 completed on my laptop in 28 seconds.
[Python 2.4.3, Celeron-M 1.3GHz, WinXP
elventear wrote:
Hi,
I am the in the need to do some numerical calculations that involve
real numbers that are larger than what the native float can handle.
I've tried to use Decimal, but I've found one main obstacle that I
don't know how to sort. I need to do exponentiation with real
Tim Peters wrote:
snip
The GNU GMP library (for which Python bindings are available) also
supports big floats, but their power operation is also restricted to
integer powers and/or exact roots. This can be painful even to try;
e.g.,
from gmpy import mpf
mpf(1e1) ** mpf(3.01)
Tim Peters wrote:
[Raymond L. Buvel, on
http://calcrpnpy.sourceforge.net/clnumManual.html
]
The clnum module handles this calculation very quickly:
from clnum import mpf
mpf(1e1) ** mpf(3.01)
mpf('9.99932861e30099',26)
That's probably good enough
Gary Wessle wrote:
Robert Kern [EMAIL PROTECTED] writes:
Raymond L. Buvel wrote:
Since you are a new Linux user, you should definitely follow Robert's
advice about building as an ordinary user separately from the install.
I sometimes take a shortcut and just do the install as user root
Gary Wessle wrote:
Hi
I am trying to install NumPy in my debian/testing linux
2.6.15-1-686.
snip
When installing from source on a Debian system, you want the installed
package to wind up in /usr/local/lib/python2.x/site-packages (where x
represents the version of Python you are running
Robert Kern wrote:
Gary Wessle wrote:
Raymond L. Buvel [EMAIL PROTECTED] writes:
When installing from source on a Debian system, you want the installed
package to wind up in /usr/local/lib/python2.x/site-packages (where x
represents the version of Python you are running the installer from
compboy wrote:
How do you print elements of the list in one line?
alist = [1, 2, 5, 10, 15]
so it will be like this:
1, 2, 5, 10, 15
because if I use this code
for i in alist:
print i
the result would be like this
1
2
5
10
15
Thanks.
There are a number of ways to
The clnum package adds rational numbers and arbitrary precision floating
point numbers in real and complex form to Python. Also provides
arbitrary precision floating point replacements for the functions in the
math and cmath standard library modules.
Home page:
Due to the contribution of Frank Palazzolo, a Windows binary installer
and build instructions are available for the clnum package. This also
makes ratfun and rpncalc usable on the Windows platform.
The clnum package adds rational numbers and arbitrary precision floating
point numbers in real and
[EMAIL PROTECTED] wrote:
Does anyone know where I can get python code to perform a CRC
calculation on an IP packet?
Check out http://crcmod.sourceforge.net/
--
http://mail.python.org/mailman/listinfo/python-list
Crcmod is a Python package for creating functions computing the Cyclic
Redundancy Check (CRC). Any generating polynomial producing 8, 16, 32,
or 64 bit CRCs is allowed. Generated functions can be used in Python or
C/C++ source code can be generated.
Home page: http://crcmod.sourceforge.net/
[EMAIL PROTECTED] wrote:
I am writing a C extension with python 2.3.5 and need constructs
similar to python
func(*args, **kwds)
What's a neat way to do that?
I found pyrex has a __Pyx_GetStarArgs -
is there something I'm missing from the regular C/API maybe using one
of the PyArg_Parse..
Peter Hansen wrote:
Larry Bates wrote:
I'm trying to get the results of binascii.crc32
to match the results of another utility that produces
32 bit unsigned CRCs.
What other utility? As Tim says, there are many CRC32s... the
background notes on this one happen to stumble out at the
Tim Peters wrote:
[Raymond L. Buvel]
Check out the unit test in the following.
http://sourceforge.net/projects/crcmod/
Cool!
I went to a lot of trouble to get the results to match the results of
binascii.crc32. As you will see, there are a couple of extra operations
even after you
Larry Bates wrote:
snip a lot of code
Looking over the code, it seems very inefficient and hard to understand.
You really should check out the following.
http://sourceforge.net/projects/crcmod/
It will allow you to generate efficient CRC functions for use in Python
and in C or C++. The only
The rpncalc package adds an interactive Reverse Polish Notation (RPN)
interpreter to Python. This interpreter allows the use of Python as
an RPN calculator. You can easily switch between the RPN interpreter
and the standard Python interpreter.
Home page: http://calcrpnpy.sourceforge.net/
The rpncalc package adds an interactive Reverse Polish Notation (RPN)
interpreter to Python. This interpreter allows the use of Python as
an RPN calculator. You can easily switch between the RPN interpreter
and the standard Python interpreter.
Home page: http://calcrpnpy.sourceforge.net/
Alex Martelli wrote:
As things stand now (gmpy 1.01), an instance d of decimal.Decimal cannot
transparently become an instance of any of gmpy.{mpz, mpq, mpf}, nor
vice versa (the conversions are all possible, but a bit laborious, e.g.
by explicitly going through string-forms).
I'm thinking
Shi Mu wrote:
any python module to calculate sin, cos, arctan?
The other answers in this thread point you to the standard modules. If
you need arbitrary precision floating point versions of these functions
check out:
http://calcrpnpy.sourceforge.net/clnumManual.html
--
Tuvas wrote:
Anyone know a module that does CRC16 for Python? I have an aplication
that I need to run it, and am not having alot of sucess. I have a
program in C that uses a CRC16 according to CCITT standards, but need
to get a program that tests it with python as well. Thanks!
Try this one
Grant Edwards wrote:
I give up, how do I make this not fail under 2.4?
fcntl.ioctl(self.dev.fileno(),0xc0047a80,struct.pack(HBB,0x1c,0x00,0x00))
I get an OverflowError: long int too large to convert to int
ioctl() is expecting a 32-bit integer value, and 0xc0047a80 has
the high-order
The rpncalc package adds an interactive Reverse Polish Notation (RPN)
interpreter to Python. This interpreter allows the use of Python as
an RPN calculator. You can easily switch between the RPN interpreter
and the standard Python interpreter.
Home page: http://calcrpnpy.sourceforge.net/
The ratfun module provides classes for defining polynomial and rational
function (ratio of two polynomials) objects. These objects can be used
in arithmetic expressions and evaluated at a particular point.
Home page: http://calcrpnpy.sourceforge.net/ratfun.html
Note: If you are using
If you are using the root finder in Numeric, and are having problems,
check out the root finder in the ratfun module. My testing indicates
that it will give the exact roots of a Wilkinson polynomial of degree
100. For more information see
http://calcrpnpy.sourceforge.net/ratfun.html
--
Chris Spencer wrote:
Is there any library for Python that implements a kind of universal
number object. Something that, if you divide two integers, generates a
ratio instead of a float, or if you take the square root of a negative,
generates a complex number instead of raising an exception?
I have just released a new module that interfaces the Class Library for
Numbers (CLN) to Python. The CLN library is a C++ library that provides
rational and arbitrary precision floating point numbers in real and
complex form. The clnum module exposes these types to Python and also
provides
I am preparing to release an extension module that interfaces Python to
the Class Library for Numbers (http://www.ginac.de/CLN/). This module
will provide Python types for arbitrary precision floating point
numbers, rational numbers, and their complex counterparts. The module
also includes most
I posted the following a while back. I think this is what you are
looking for.
This can be done fairly easily by creating a module (lets call it
interactive) with the following code in it.
---
import sys,os
def debug_exception(type, value, traceback):
# Restore redirected standard
Alex Renelt wrote:
Alex Renelt wrote:
in addition:
I'm writing a class for polynomial manipulation. The generalization of
the above code is:
definitions:
1.) p = array([a_0, a_i, ..., a_n]) represents your polynomial
P(x) = \sum _{i=0} ^n a_i x^i
2.) deg(p) is its degree
3.) monic(p) makes P
David Joyner wrote:
Hi:
I'm trying to compile python 2.4 with tkinter.
(I'm trying to write a gui interface which
calls a program called GAP - I'm hoping to use
subprocess, a python 2.4 module, since I was getting
deadlocks using popen).
The instructions at the python web site said basically
to
The ratfun module provides classes for defining polynomial and rational
function (ratio of two polynomials) objects. These objects can be used
in arithmetic expressions and evaluated at a particular point.
Home page: http://calcrpnpy.sourceforge.net/ratfun.html
Note: If you are using
Bo Peng wrote:
Dear list,
I am writing a Python extension module that needs a way to expose pieces
of a big C array to python. Currently, I am using NumPy like the following:
PyObject* res = PyArray_FromDimsAndData(1, int*dim, PyArray_DOUBLE,
char*buf);
Users will get a Numeric Array object
Mike Meyer wrote:
PEP: XXX
Title: A rational number module for Python
snip
I think it is a good idea to have rationals as part of the standard
distribution but why not base this on the gmpy module
(https://sourceforge.net/projects/gmpy)? That module already provides
good performance. However,
46 matches
Mail list logo