Octave style guide: Difference between revisions

(Add note about != vs ~=)
Line 190: Line 190:
== ! operator ==
== ! operator ==


The Octave operator {{codeline|!}} should be used for logical negation, rather than
* The Octave operator <code>!</code> should be used for logical negation, rather than <code>~</code>.
{{codeline|~}}. The negation operator is written with a space between the operator
* The negation operator is written with a space between the operator and its target, e.g., <code>! A</code>.
and its target, e.g., {{codeline|! A}}.
* For comparisons use <code>!=</code> instead of <code>~=</code>.
 
Use {{codeline|!=}} instead of {{codeline|~=}}.


== Comments ==
== Comments ==