[issue10596] modulo operator bug

2011-04-21 Thread Mark Dickinson

Mark Dickinson  added the comment:

Raymond: just curious---why do you ask?  Did this fix break something?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10596] modulo operator bug

2011-04-19 Thread Tim Peters

Tim Peters  added the comment:

Raymond, Mark pointed to the footnote explaining the first result.  As to the 
second, Kahan tried his best, but I'm afraid nobody can make me care about the 
sign bit on a zero ;-)  Whatever Mark thought best is fine by me.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10596] modulo operator bug

2011-04-19 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Uncle Timmy, was this the right thing to do?

--
assignee: mark.dickinson -> tim_one
nosy: +rhettinger, tim_one

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10596] modulo operator bug

2010-12-05 Thread Сергей Хлутчин

Сергей Хлутчин  added the comment:

Yes i agree,
the first example is the result of rounding error, as well as here:
>>> 4.0-2.22044604925e-16==4.0
True

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10596] modulo operator bug

2010-12-04 Thread Mark Dickinson

Mark Dickinson  added the comment:

Backported to 3.1 (after one botched backport attempt) and 2.7 in r87037 and 
r87033.

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10596] modulo operator bug

2010-12-04 Thread Mark Dickinson

Mark Dickinson  added the comment:

Fixed the sign of the zero (in py3k) in r87032.  I'll backport to 2.7 and 3.1, 
then close this.

Sergio, is that acceptable?  You still haven't said what results you were 
expecting for these operations.

--
resolution:  -> fixed
stage:  -> committed/rejected
versions: +Python 2.7, Python 3.1 -Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10596] modulo operator bug

2010-12-01 Thread Mark Dickinson

Mark Dickinson  added the comment:

Did you look at the second footnote on that page?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10596] modulo operator bug

2010-12-01 Thread Сергей Хлутчин

Сергей Хлутчин  added the comment:

>From the documetation:
The modulo operator always yields a result with the same sign as its second 
operand (or zero); the absolute value of the result is strictly smaller than 
the absolute value of the second operand.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10596] modulo operator bug

2010-12-01 Thread Mark Dickinson

Mark Dickinson  added the comment:

What results were you expecting here?  Both those results look fine to me 
(though it's arguable that the second should be +0.0 rather than -0.0).

--
assignee:  -> mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10596] modulo operator bug

2010-12-01 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10596] modulo operator bug

2010-12-01 Thread Сергей Хлутчин

New submission from Сергей Хлутчин :

Result of the modulo operator is wrong:

>>> (-2.22044604925e-16)%4
4.0
>>> (-4.0)%4
-0.0

--
messages: 122991
nosy: Sergio.Ĥlutĉin
priority: normal
severity: normal
status: open
title: modulo operator bug
type: behavior
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com