Ticket #4 (new defect)
Opened 3 years ago
Truncating division and Guido van Rossum's Python 3000 Google Video
| Reported by: | emuller | Owned by: | somebody |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | component1 | Version: | |
| Keywords: | Cc: |
Description
Just watching Guido van Rossum's Talk on Python 3000 at Google Video ...
Did you ever notice this:
3/4 = 0 3.0/4 = 0.75 3//4 = 0 3.0//4 = 0.0
This behavior I find better:
from __future__ import division 3/4 = 0.75 3//4 = 0 3.0/4 = 0.75 3.0//4 = 0.0
I didn't know '//' was unambiguous truncating division ... nice. Of course '%' returns the remainder.
Note: See
TracTickets for help on using
tickets.
