Robert Kern wrote:
> [EMAIL PROTECTED] wrote:
>
>
>>float('inf') works well, no?
> It is not cross-platform. The parsing of strings into floats and the string
> representation of floats is dependent on your system's C library. For these
> special values, this differs across platforms. Your code
[EMAIL PROTECTED] wrote:
> float('inf') works well, no?
>
>>>> inf = float('inf')
>>>> inf / inf
>nan
>>>> -inf
>-inf
>>>> inf / 0
>ZeroDivisionError: float division
>>>> 1 / inf
>0.0
>>>> 0 * float('inf')
>nan
It is not cross-platform. The parsing of
On Jun 27, 6:41 am, andrea <[EMAIL PROTECTED]> wrote:
> I would like to have a useful rappresentation of infinite, is there
> already something??
>
> I was thinking to something like this
>
> class Inf(int):
> """numero infinito"""
> def __init__(self,negative=False):
>
Mm very interesting thread, for my needs from numpy import inf is more
than enough :)
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
>> No. You can make one that fits your requirements, though.
>
> I am struggling to oversee the implications of design choices for inf
> behaviour - especially if it comes to comparison with float type inf.
> The type in my application contains a gmpy.mpq and a float that
"John Nagle" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
|If Python numerics don't define
| +INF, -INF, and NaN, along with the tests for them, that's a
| flaw in the language.
Are you volunteering to fix the 'flaw'? CPython floating point numerics
are currently defined to
Robert Kern wrote:
> [EMAIL PROTECTED] wrote:
>
>>On Thu, 28 Jun 2007 23:20:30 -0500
>>Robert Kern <[EMAIL PROTECTED]> wrote:
>>
>>
>>>[EMAIL PROTECTED] wrote:
>>>
Does it differ from the
built-in inf?
>>>
>>>What built-in inf?
>>
>>$ python
>>Python 2.4.4 (#2, Apr 5 2007, 20:11:18)
>>[GC
[EMAIL PROTECTED] wrote:
> On Thu, 28 Jun 2007 23:20:30 -0500
> Robert Kern <[EMAIL PROTECTED]> wrote:
>
>> [EMAIL PROTECTED] wrote:
>>> Does it differ from the
>>> built-in inf?
>> What built-in inf?
>
> $ python
> Python 2.4.4 (#2, Apr 5 2007, 20:11:18)
> [GCC 4.1.2 20061115 (prerelease) (Debi
On Thu, 28 Jun 2007 23:20:30 -0500
Robert Kern <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Does it differ from the
> > built-in inf?
>
> What built-in inf?
$ python
Python 2.4.4 (#2, Apr 5 2007, 20:11:18)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "
[EMAIL PROTECTED] wrote:
> On Wed, 27 Jun 2007 11:59:29 -
> Rob De Almeida <[EMAIL PROTECTED]> wrote:
>
>> On Jun 27, 6:41 am, andrea <[EMAIL PROTECTED]> wrote:
>>> I would like to have a useful rappresentation of infinite, is there
>>> already something??
>> from numpy import inf
>
> $ pytho
On Wed, 27 Jun 2007 11:59:29 -
Rob De Almeida <[EMAIL PROTECTED]> wrote:
> On Jun 27, 6:41 am, andrea <[EMAIL PROTECTED]> wrote:
> > I would like to have a useful rappresentation of infinite, is there
> > already something??
>
> from numpy import inf
>
$ python
Python 2.4.4 (#2, Apr 5 2007
On Jun 27, 6:41 am, andrea <[EMAIL PROTECTED]> wrote:
> I would like to have a useful rappresentation of infinite, is there
> already something??
from numpy import inf
--
http://mail.python.org/mailman/listinfo/python-list
I would like to have a useful rappresentation of infinite, is there
already something??
I was thinking to something like this
class Inf(int):
"""numero infinito"""
def __init__(self,negative=False):
self.negative = negative
def __cmp__(self,y):
13 matches
Mail list logo