bugGNU Octave - Bugs: bug #31279, unary minus

 
 

bug #31279: unary minus

Submitted by:  Wolf <wolf74>
Submitted on:  Fri 08 Oct 2010 09:07:58 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.2.4Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 08 Oct 2010 09:25:02 PM UTCjweStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1