<number> = <value> > <value>
<number> = <value> < <value>
<number> = <value> >= <value>
<number> = <value> <= <value>
<number> = <value> == <value>
<number> = <value> != <value>
Operators: Comparisons > < >= <= != ==Compare two Glossary: Valuevalues. Flow control: if … then Flow control: try … thenThe results in a <number>: 1 for 'true' Operators: Boolean Or with Variable "||=" Operators: Bitwise Or with Variable "|=" Operators: Bitwise Or "|" Operators: Boolean Or "||"or 0 for 'false'.
Comparison Vipsi command syntax: Operators Operators Glossary: Operatoroperators Flow control: do … loopdo no type conversion. Compared Glossary: Valuevalues must be of same type. Comparing Glossary: Valuevalues of different type results in an error.
Data Types: NumbersNumbers are compared numerically.
Comparing NaNs (not-a-number, e.g. Flow control: if … then Flow control: try … thenthe result of 0.0/0.0) is handled in accordance to IEEE, which in essence means, that Flow control: if … thenif a is NaN Flow control: if … then Flow control: try … thenthen a is Operators: Bitwise Not "~" Operators: Boolean Negation "!"not equal to any other Glossary: number, num_valnumber, Operators: Bitwise Not "~" Operators: Boolean Negation "!"not even other NaNs, Operators: Bitwise Not "~" Operators: Boolean Negation "!"not even to itself. Flow control: if … thenIf one side of a comparison is a NaN, Flow control: if … then Flow control: try … thenthen only Vipsi command syntax: Operators Operators Glossary: Operatoroperator != Flow control: returnreturns true. (Operators: Bitwise Not "~" Operators: Boolean Negation "!"note: might be changed. makes things unsortable.)
Glossary: text, text_valText values are compared alphabetically by comparing character for character starting Operators: Make Identifier "@"at Numeric functions: indexindex 1. Flow control: if … then Flow control: try … thenThe character code is compared, no semi-intelligent character mapping is applied.
Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_valLists are compared by comparing matching items starting Operators: Make Identifier "@"at Numeric functions: indexindex 1. Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_valList items may be of different type. Flow control: if … then Flow control: try … thenThen their character type is compared, just assuring a sortable ordering. No conversion whatsoever applied.
Even Vipsi command syntax: Procedures Data Types: Procedures Glossary: Procedureprocedures may be compared though it may Operators: Bitwise Not "~" Operators: Boolean Negation "!"not be evident how they are ordered.
e.g.:
Flow control: if … thenif (a>55) Instructions: putput "a>55" Flow control: if … then Flow control: try … thenthen
Flow control: if … thenif (b>"aaa") Instructions: putput "b>aaa" Flow control: if … then Flow control: try … thenthen
Flow control: if … thenif a!=a Instructions: putput "a is Operators: Bitwise Not "~" Operators: Boolean Negation "!"not a Glossary: number, num_valnumber (NaN)" Flow control: if … then Flow control: try … thenthen
|