| 1|Expression '+' |Result | Test |Comment | | | 2| {=1+2 3}| 3| {=RC[-1]=RC[-2] TRUE} |Simple addition. | | | 3| {=..\TestData.stx#B4+..\TestData.stx#B5 5}| 5| {=RC[-1]=RC[-2] TRUE} |2+3 is 5. | | | 4|Expression '-' |Result | Test |Comment | | | 5| {=3-1 2}| 2| {=RC[-1]=RC[-2] TRUE} |Simple subtraction. | | | 6| {=..\TestData.stx#B5-..\TestData.stx#B4 1}| 1| {=RC[-1]=RC[-2] TRUE} |3-2 is 1. | | | 7| {={5 - - 2} 7}| 7| {=RC[-1]=RC[-2] TRUE} |Subtraction can be combined with unary minus. | | | 8| {=5--2 7}| 7| {=RC[-1]=RC[-2] TRUE} |Subtraction can be combined with unary minus, even without spaces | | | 9| {=3-2+3 4}| 4| {=RC[-1]=RC[-2] TRUE} |Left-to-right associative | | | 10| {=..\TestData.stx#C8-..\TestData.stx#C7 365.00:00:00}| 365| {=RC[-1]=RC[-2] TRUE} |Difference of two dates is the number of days between them. | | | 11|Expression '*' |Result | Test |Comment | | | 12| {=3*4 12}| 12| {=RC[-1]=RC[-2] TRUE} |Simple multiplication. | | | 13| {=..\TestData.stx#B4*..\TestData.stx#B5 6}| 6| {=RC[-1]=RC[-2] TRUE} |2*3 is 6. | | | 14| {=2+3*4 14}| 14| {=RC[-1]=RC[-2] TRUE} |Multiplication has a higher precedence than addition. | | | 15|Expression '/' |Result | Test |Comment | | | 16| {=6/3 2}| 2| {=RC[-1]=RC[-2] TRUE} |Simple division. | | | 17| {=144/3/2 24}| 24| {=RC[-1]=RC[-2] TRUE} |Division is left-to-right associative | | | 18| {=6/3*2 4}| 4| {=RC[-1]=RC[-2] TRUE} |Division and multiplication are left-to-right | | | 19| {=2+6/2 5}| 5| {=RC[-1]=RC[-2] TRUE} |Division has a higher precedence than +. | | | 20| {=5/2 2.5}| 2.5| {=RC[-1]=RC[-2] TRUE} |Simple division; fractional values are possible. | | | 21| {=1/0 #DIV/0!} | #DIV/0! | {=RC[-1]=RC[-2] TRUE} |Dividing by zero is not allowed. | | | 22|Expression '^' |Result |Comment | | | 23| {=2^3 8}| 8| {=RC[-1]=RC[-2] TRUE} |Simple exponentiation. | | | 24| {=9^0.5 3}| 3| {=RC[-1]=RC[-2] TRUE} |Raising to the 0.5 power is the same as a square root. | | | 25| {=(-5)^3 -125}| -125| {=RC[-1]=RC[-2] TRUE} |Must be able to accept Left < 0. | | | 26| {=4^-1 0.25}| 0.25| {=RC[-1]=RC[-2] TRUE} |Must be able to accept Right < 0. | | | 27| {=5^0 1}| 1| {=RC[-1]=RC[-2] TRUE} |Raising nonzero to the zeroth power results in 1. | | | 28| {=0^5 0}| 0| {=RC[-1]=RC[-2] TRUE} |Raising zero to nonzero power results in 0. | | | 29| {=2+3*4^2 50}| 50| {=RC[-1]=RC[-2] TRUE} |Precedence: ^ is higher than *, which is higher than +. | | | 30| {=-2^2 4}| 4| {=RC[-1]=RC[-2] TRUE} |Unary “-” has a higher precedence than “^”. | | | 31| {=(2^3)^2 64}| 64| {=RC[-1]=RC[-2] TRUE} |8^2 is the square of 8 | | | 32| {=2^(3^2) 512}| 512| {=RC[-1]=RC[-2] TRUE} |2 to the ninth power | | | 33| {=2^3^2 64}| 64| {=RC[-1]=RC[-2] TRUE} |“^” is left-associative, not right-associative | | | 34|Expression '=' |Result | Test |Comment | | | 35| {=1=1 TRUE} | TRUE | {=RC[-1]=RC[-2] TRUE} |Trivial comparison. | | | 37| {=1=0 FALSE} | FALSE | {=RC[-1]=RC[-2] TRUE} |Trivial comparison. | | | 38| {=3=3.0001 FALSE} | FALSE | {=RC[-1]=RC[-2] TRUE} |Grossly wrong equality results are not acceptable. Spreadsheets cannot “pass” automated tests by simply making “=“ always return TRUE when it's even slightly close. | | | 39| {="Hi"="Bye" FALSE} | FALSE | {=RC[-1]=RC[-2] TRUE} |Trivial text comparison - no match. | | | 40| {=FALSE()=FALSE() TRUE} | TRUE | {=RC[-1]=RC[-2] TRUE} |Can compare Logical values. | | | 41| {=TRUE()=FALSE() FALSE} | FALSE | {=RC[-1]=RC[-2] TRUE} |Can compare Logical values. | | | 42| {="5"=5 TRUE} |False | {=RC[-1]=RC[-2] FALSE} |Different types are not equal. | | | 43| {=ISNA(NA()=NA()) FALSE} | TRUE | {=RC[-1]=RC[-2] FALSE} |If there's an error on either side, the result is an error -- even if you're comparing the “same” error on both sides. | | | 44| {="Hi"="HI" TRUE} |True | {=RC[-1]=RC[-2] TRUE} |Note, this is only true if HOST-CASE-SENSITIVE is false. | | | 55|Expression |Result | Test |Comment | | | 56| {=1<>1 FALSE} | FALSE | {=RC[-1]=RC[-2] TRUE} |1 really is 1. | | | 57| {=1<>2 TRUE} | TRUE | {=RC[-1]=RC[-2] TRUE} |1 is not 2. | | | 58| {=1<>"1" FALSE} | TRUE | {=RC[-1]=RC[-2] FALSE} |Text and Number have different types. | | | 59| {="Hi"<>"HI" FALSE} | FALSE | {=RC[-1]=RC[-2] TRUE} |Text comparison ignores case distinctions. Note, this is only true if HOST-CASE-SENSITIVE is false. | | | 60| {=1/0=1/0 #DIV/0!} | #DIV/0! | {=RC[-1]=RC[-2] TRUE} |This operator cannot compare error values to determine if they are the same error. If either side is an error, the result is an error. | | | 61|Expression |Result | Test |Comment | | | 62| {=5<6 TRUE} | TRUE | {=RC[-1]=RC[-2] TRUE} |Trivial comparison. | | | 63| {=5<=6 TRUE} | TRUE | {=RC[-1]=RC[-2] TRUE} |Trivial comparison. | | | 64| {=5>6 FALSE} | FALSE | {=RC[-1]=RC[-2] TRUE} |Trivial comparison. | | | 65| {=5>=6 FALSE} | FALSE | {=RC[-1]=RC[-2] TRUE} |Trivial comparison. | | | 66| {="A"<"B" TRUE} | TRUE | {=RC[-1]=RC[-2] TRUE} |Trivial comparison of text. | | | 67| {="a"<"B" TRUE} | TRUE | {=RC[-1]=RC[-2] TRUE} |True when HOST-CASE-SENSITIVE is false. | | | 68| {="AA">"A" TRUE} | TRUE | {=RC[-1]=RC[-2] TRUE} |Longer text is "larger" than shorter text, if they match in case-insensitive way through to the end of the shorter text. | | | 72|{={"Hi "&"there"} Hi there} |Hi there | {=RC[-1]=RC[-2] TRUE} |Simple concatenation. | | | 73|{="H"&"" H} |H | {=RC[-1]=RC[-2] TRUE} |Concatenating an empty string produces no change. | | | 74|{=-5&"b" -5b} |-5b | {=RC[-1]=RC[-2] TRUE} |Unary "-" has higher precedence than "&" | | | 75|{=3&2-1 31} | 31| {=RC[-1]=RC[-2] TRUE} |Binary "-" has higher precedence than "&" | | | 76|Expression |Result | Test |Comment | | | 77| {=50% 0.5}| 0.5| {=RC[-1]=RC[-2] TRUE} |Simple percent value. | | | 78| {=20+50% 20.5}| 20.5| {=RC[-1]=RC[-2] TRUE} |Percent does not change the meaning of other operations; this is not 30. | | | 79| {=3^200% 9}| 9| {=RC[-1]=RC[-2] TRUE} |Percent has a higher precedence than “^” | | | 80|{=..\TestData.stx#B4 2} | 2| {=RC[-1]=RC[-2] TRUE} |Percent could be used as a Postfix operator, but that would be a poor use, since Numbers should not be changed | | | 82| {=5 5}| 5| {=RC[-1]=RC[-2] TRUE} |Numbers don't change | | | 83|{=+"Hello" Hello} |Hello | {=RC[-1]=RC[-2] TRUE} |Does not convert a string to a number. | | | 84| {=-..\TestData.stx#B4 -2}| -2| {=RC[-1]=RC[-2] TRUE} |Negated 2 is -2. | | | 85| {=-2=(0-2) TRUE} | TRUE | {=RC[-1]=RC[-2] TRUE} |Negative numbers are fine. | | | 86|=..\TestData.stx#B4=2 | TRUE | {=RC[-1]=RC[-2] TRUE} |References are converted into numbers, and then compared. | | This is a Sample *.STX File. (C) http://Spoc-Web.com