| Line 468: |
Line 468: |
| | |} | | |} |
| | | | |
| − | ==MORE== | + | ==Unit Aware Logical Operations== |
| | + | |
| | + | Unit aware variables and arrays can also be operated on with Unit Aware Logical Operators and Unit Aware Mathematical Operators. Such operators are listed in [[Unit_Operators]]. |
| | + | |
| | + | Is 1m greater than 1cm? |
| | + | |
| | + | 1m<>>1cm; |
| | | | |
| − | (1..100)<>l<>ul
| + | true |
| − | 1Pa<>atm
| + | |
| | + | Is 1m greater than 1cm, and is 2m greater than 200cm? |
| | + | |
| | + | [1m,2m]<>>[1cm,200cm]; |
| | + | |
| | + | Answer is: |
| | + | |
| | + | [true, false]. Note that an array of answers is obtained here. |
| | | | |
| − | E:=(m<>kg)<*>(SPEEDOFLIGHT()<^>2);
| + | Is 1m greater than or equal to 1cm, and is 2m greater or equal to than 200cm? |
| − | b=E(2g);
| + | |
| − | ConvertToUnitOfNature(b,"energy")
| + | [1m,2m]<>=>[1cm,200cm]; |
| | + | |
| | + | Answer is: |
| | + | |
| | + | [true, true]. |
| | | | |
| − | 1m<>>1cm;
| + | Is 1m less than 1cm, and is 2m less than 200cm? |
| | | | |
| − | [1m,2m]<>>[1cm,200cm];
| + | [1m,2m]<<>[1cm,200cm]; |
| | + | |
| | + | Answer is: |
| | + | |
| | + | [false,false] |
| | + | |
| | + | Is 1m equal to 1cm, and is 2m equal to 200cm? |
| | + | |
| | + | [1m,2m]<==>[1cm,200cm]; |
| | + | |
| | + | Answer is: |
| | + | |
| | + | [false,true] |
| | + | |
| | + | Is 1m not equal to 1cm, and is 2m not equal to 200cm? |
| | + | |
| | + | [1m,2m]<!=>[1cm,200cm]; |
| | + | |
| | + | Answer is: |
| | + | |
| | + | [true,false] |
| | + | |
| | + | Is 1m less than 1cm, and is 2m less than 199.99cm? |
| | | | |
| − | [1m,2m]<>=>[1cm,200cm];
| + | [1m,2m]<<=>[1cm,199.99cm]; |
| | + | |
| | + | Answer is: |
| | + | |
| | + | [false,false] |
| | + | |
| | + | Is 1m less than or equal to 1cm, and is 2m less than or equal to 199.99cm? |
| | | | |
| − | [1m,2m]<<>[1cm,200cm];
| + | [1m,2m]<<=>[1cm,200.01cm]; |
| | + | |
| | + | Answer is: |
| | + | |
| | + | [false,true] |
| | + | |
| | + | Also note that it is not necessary for both sides of these to be the same size. For example, the following is a check to see which all numbers between 1m to 10m are greater than 3m. |
| | + | |
| | + | ((1..10)<>m)<>>3m; |
| | + | |
| | + | And the answer is: |
| | + | |
| | + | |
| | + | {| class="wikitable"|- |
| | + | | false |
| | + | |- |
| | + | | false |
| | + | |- |
| | + | | false |
| | + | |- |
| | + | | true |
| | + | |- |
| | + | | true |
| | + | |- |
| | + | | true |
| | + | |- |
| | + | | true |
| | + | |- |
| | + | | true |
| | + | |- |
| | + | | true |
| | + | |- |
| | + | | true |
| | + | |} |
| | + | |
| | + | The following is a check to see which all numbers in the series 0.1m, 1.1m, upto 10m are greater than 30cm. |
| | | | |
| − | [1m,2m]<<>[1cm,200cm];
| + | ((0.1..10)<>m)<>>30cm |
| | + | |
| | + | The answer is: |
| | + | |
| | + | {| class="wikitable" |
| | + | |- |
| | + | ! Numeric !! Units !! UNITSOF |
| | + | |- |
| | + | | 0.1 || m || 0.1m |
| | + | |- |
| | + | | 1.1 || m || 1.1m |
| | + | |- |
| | + | | 2.1 || m || 2.1m |
| | + | |- |
| | + | | 3.1 || m || 3.1m |
| | + | |- |
| | + | | 4.1 || m || 4.1m |
| | + | |- |
| | + | | 5.1 || m || 5.1m |
| | + | |- |
| | + | | 6.1 || m || 6.1m |
| | + | |- |
| | + | | 7.1 || m || 7.1m |
| | + | |- |
| | + | | 8.1 || m || 8.1m |
| | + | |- |
| | + | | 9.1 || m || 9.1m |
| | + | |} |
| | + | |
| | + | |
| | | | |
| − | [1m,2m]<==>[1cm,200cm];
| + | |
| | + | ==MORE== |
| | | | |
| − | [1m,2m]<!=>[1cm,200cm]; | + | (1..100)<>l<>ul |
| | + | 1Pa<>atm |
| | | | |
| − | [1m,2m]<<=>[1cm,199.99cm]; | + | E:=(m<>kg)<*>(SPEEDOFLIGHT()<^>2); |
| − |
| + | b=E(2g); |
| − | [1m,2m]<<=>[1cm,200.01cm];
| + | ConvertToUnitOfNature(b,"energy") |
| − |
| + | |
| − | ((1..10)<>m)<>>3m;
| |
| − | | |
| − | ((0.1..10)<>m)<>>30cm | |
| | | | |
| | | | |