octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Operator precedence tests show 3 failures


From: Ben Abbott
Subject: Re: Operator precedence tests show 3 failures
Date: Sun, 20 Mar 2011 06:47:26 -0400

On Mar 20, 2011, at 4:42 AM, marco atzeri wrote:

> On Fri, Mar 18, 2011 at 5:40 PM, Rik  wrote:
>> 3/18/11
>> 
>> I just checked in some tests for the Octave parser (test_parser.m in
>> tests/).  The current parser shows 3 failures.  These are known, but until
>> jwe gets a chance to modify his proposed patch be aware that your 'make
>> check' will not run cleanly.
>> 
>> --Rik
>> 
> 
> at least 1 seems obvious
> -------------------------------------------
> assert ([2, 3] .^ 2',[4; 9]) expected
>   4
>   9
> but got
>   4   9
> Dimensions don't match
> -------------------------------------------
> 
> the test should be:
> 
> assert ([2; 3] .^ 2',[4; 9]) expected
> 
> to match dimensions of argument and result
> Marco

Apparently the transpose operator has the same precedence as the exponential 
operator.

In Matlab ...

>> [2; 3] .^ 2'

ans =

     4     9

>> ([2; 3] .^ 2)'

ans = 

    4     9

In octave ...

octave:1>  [2; 3] .^ 2'
ans =

   4
   9

octave:2>  ([2; 3] .^ 2)'
ans =

   4   9

Ben





reply via email to

[Prev in Thread] Current Thread [Next in Thread]