bugGNU Octave - Bugs: bug #31279, unary minus

 
 

bug #31279: unary minus

Submitter:  Wolf <wolf74>
Submitted:  Fri 08 Oct 2010 09:07:58 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.2.4 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 08 Oct 2010 09:25:02 PM UTC, comment #1: 

This is not a bug.  Unary minus has a lower precedence than the power operator, so -2^2 is equivalent to -(2^2).

John W. Eaton <jwe>
Group administrator
Fri 08 Oct 2010 09:07:58 PM UTC, original submission:  

different results using unary minus and power operators:

(-2)^2
ans=4
-2^2
ans=-4

Wolf <wolf74>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by wolf74 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-10-08 jwe StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code