Overview
| Artifact ID: | c869f51a5a0b224df639acf7eb255a2243f7cc1c |
|---|---|
| Ticket: | 218243ffffffffffffffffffffffffffffffffff
expr operator precedence |
| User & Date: | nobody on 2000-10-26 00:54:59 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 2813 Bug Version: 8.2 SubmitDate: '1999-09-16' LastModified: '1999-09-16' Severity: MED Status: Closed Submitter: techsupp ChangedBy: hobbs OS: Linux-Red Hat Machine: Other FixedDate: '2000-10-25' ClosedDate: '1999-09-16' Name: John Ellson ReproducibleScript: expr -2^2 expr -2^2+2^2 expr 2^2-2^2 expr 2^-2^2 ObservedBehavior: according to tcl: -2^2 = -4 -2^2+2^2 = -8 2^2-2^2 = 0 2^-2^2 = -2 DesiredBehavior: according to matlab -2^2 = -4 -2^2+2^2 = 0 2^2-2^2 = 0 2^-2^2 = 0.0625 according to perl: bash>> perl -e '$x=-2**2;print "$x\n";' -4 bash>> perl -e '$x=-2**2+2**2;print "$x\n";' 0 bash>> perl -e '$x=+2**2-2**2;print "$x\n";' 0 bash>> perl -e '$x=+2**-2**2;print "$x\n";' 0.0625 The user was confusing the Tcl bitwise XOR (^) with the power function (expr pow(base,exp)). -- 09/16/1999 hobbs - foundin changed to: "obsolete: 8.2"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "69. Other"
- title changed to: "expr operator precedence"
- type changed to: "Bug"