Overview
| Artifact ID: | 009b6203d41f8902b39e4d7c181425d19edf6140 |
|---|---|
| Ticket: | 2931407fffffffffffffffffffffffffffffffff
expr.n should document integer division rounding |
| User & Date: | cjmcdonald on 2010-01-13 15:25:14 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
The expr.n man pages refers to a C manual for a description of the behaviour of arithmetic operators. But, in Tcl [expr { -57/10 }] gives -6, rounding towards minus infinity. This was a surprise to me, as most C implementations round towards zero, and -57/10 returns -5. Googling, the latest C standard ISO 9899:1999 actually specifies rounding towards zero in this case. Previously it appears to have been "implementation dependant". So we are now at odds with standard C here. I think that the expr.n man page should document this behaviour. - foundin changed to: "obsolete: 8.5.8"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "cjmcdonald"
- subsystem changed to: "45. Parsing and Eval"
- title changed to: "expr.n should document integer division rounding"
- type changed to: "Bug"