bugGNU Octave - Bugs: bug #31246, Inconsistent behavior of .^

 
 

bug #31246: Inconsistent behavior of .^

Submitted by:  None
Submitted on:  Mon 04 Oct 2010 08:15:59 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.4
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 04 Oct 2010 09:03:27 PM UTC, comment #2:

I just came back to rescind this, since I realized it was just a precedence issue. Too late, you're quick. Sorry for the non-bug.

Anonymous
Mon 04 Oct 2010 08:28:15 PM UTC, comment #1:

The .^ operator has a higher precedence than the - operator and so your two statement written differently ar

-(0.5 .^ (2/3))

and

(-0.5) .^ (2/3)

Are you really surprised they aren't equal? Read section 8.8 of the manual at

http://www.gnu.org/software/octave/doc/interpreter/Operator-Precedence.html#Operator-Precedence

for more information.

D.

David Bateman <dbateman>
Project Member
Mon 04 Oct 2010 08:15:59 PM UTC, original submission:

I cannot think of a reason for these two results to be different. I would expect the second result to be the same as the first.

octave:70> -0.5 .^ (2/3)
ans = -0.62996
octave:71> [-0.5] .^ [(2/3)]
ans = -0.31498 + 0.54556i

octave:72> abs(ans)
ans = 0.62996

I was unable to find similar reported bugs, or test with a newer version.

Anonymous

 

(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 dbateman (Posted a comment)
  • -unavailable- added by None (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
    Mon 04 Oct 2010 08:28:15 PM UTCdbatemanStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1