"<>" causes syntax error

John W. Eaton jwe at bevo.che.wisc.edu
Tue Mar 18 13:01:15 CDT 2008


On 14-Mar-2008, Sergei Steshenko wrote:

| I've tried to use "<>" operator:
| 
| "
| octave:52> if(1 <> 2) printf("not equal\n"); endif
| parse error:
| 
|   syntax error
| 
| >>> if(1 <> 2) printf("not equal\n"); endif
|           ^
| 
| octave:52>  
| ".
| 
| According to http://www.gnu.org/software/octave/doc/interpreter/Comparison-Ops.html#Comparison-Ops
| :
| 
| "
| x <> y
| True if x is not equal to y.
| ".
| 
| Other variants work:
| 
| "
| octave:52> if(1 != 2) printf("not equal\n"); endif
| not equal
| octave:53> if(1 ~= 2) printf("not equal\n"); endif
| not equal
| octave:54>
| ".
| 
| 'octave' version is 3.0.0.

The <> operator is obsolete and was intentionally removed from
Octave.  I've deleted it from the manual now.

jwe


More information about the Bug-octave mailing list