Integers are handled in their two's complement form.
Examples
True && FalseFalse12 && 74And stops to evaluate its arguments if False occurs.
(Print(1);True) && False && (Print(2);True)1False
Expressions which are evaluated into True will be erased.
2==2 && a==5 && b==10 && Truea == 5 && b == 10
Depth( { {1,2}, 3, {4,{5,6}} } )3Depth( 123 )0
Depth works with any expressions, not only lists.
Depth( a + 2*b + c )2Depth( f(x^2) )2
Rational and complex numbers have a depth of 0.
Depth( 1/3 )0Depth( 1+2*I )0
gives True if all expressions expi are mathematically equal, and False otherwise.
Details
Equal verify the expressions for mathematical equality unlike Same===.
Examples
1 == 1True
Integer 1 and Real 1.0 are mathematically equal, but not identical.
{ 1 == 1.0 , 1 === 1.0 }{True, False}
The equality of Overflows is unknown, but they are identical.
{ Overflow == Overflow , Overflow === Overflow }{Overflow == Overflow, True}Equal stays unevaluated if equality is unknown.
a == ba == b
gives True if xi is greater than xi + 1 for all arguments, and False if xi is less than or equal to xi + 1 for at least one pair.
Details
For exact expressions in xi, Greater compares the approximated value.
Examples
2 > 1True1/3 > 0 > -0.5Truex > 2 > 2False
The comparison will be simplified if possible.
2 > 1 > x1 > x
The value of an exact expression is approximated for comparison.
Sin(2) > 0True
gives True if xi is greater than or equal to xi + 1 for all arguments, and False if xi is less than xi + 1 for at least one pair.
Details
For exact expressions in xi, GreaterEqual compares the approximated value.
Examples
2 >= 1True3/2 >= 1.5 >= -0.5Truex >= 1 >= 2False
The comparison will be simplified if possible.
2 >= 1 >= x1 >= x
The value of an exact expression is approximated for comparison.
Sin(2) >= 0True
Join( {1,2} , {3,4,5} ){1, 2, 3, 4, 5}Join( "Hello ", "World!" )"Hello World!"
Join works with any expressions, not only lists, as long as they have the same head.
Join( a + b , c + d )a + b + c + dJoin( f(1, 2), f(x) )f(1, 2, x)
Length( {1,2,3,4,5} )5Length( "Hello World!" )12
Length works with any expressions, not only lists.
Length( a + 2*b + c )3Length( f(a, b) )2
Rational and complex numbers have a length of 0.
Length( 1/3 )0Length( 1+2*I )0
gives True if xi is less than xi + 1 for all arguments, and False if xi is greater than or equal to xi + 1 for at least one pair.
Details
For exact expressions in xi, Less compares the approximated value.
Examples
1 < 2True-0.5 < 0 < 1/3Truex < 2 < 2False
The comparison will be simplified if possible.
1 < 2 < x2 < x
The value of an exact expression is approximated for comparison.
Sin(4) < 0True
gives True if xi is less than or equal to xi + 1 for all arguments, and False if xi is greater than xi + 1 for at least one pair.
Details
For exact expressions in xi, LessEqual compares the approximated value.
Examples
1 <= 2True-0.5 <= 1.5 <= 3/2Truex <= 2 <= 1False
The comparison will be simplified if possible.
1 <= 2 <= x2 <= x
The value of an exact expression is approximated for comparison.
Sin(4) <= 0True
Integers are handled in their two's complement form.
Examples
! FalseTrue! 15-16
Negation of comparisons are simplified if possible.
Not( x < 3 )x >= 3
Double negation of an expression is the expression itself.
Not( Not( exp ) )exp
Integers are handled in their two's complement form.
Examples
True || FalseTrue12 || 715Or stops to evaluate its arguments if True occurs.
(Print(1);False) || True || (Print(2);False)1True
Expressions which are evaluated into False will be erased.
1==2 || a==5 || b==10 || Falsea == 5 || b == 10
gives the expression with all elements in this level or the string with all characters.
Examples
Pick an element or a character:
Part( {a,b,c,d,e} , 3 )c"Hello World!"[-1]"!"
Pick multiple elements or characters:
{a,b,c,d,e}[{-1,3,3}]{e, c, c}"Hello World!"[{1,8,3,-2}]"Hold"
Pick a Span of elements or characters:
{a,b,c,d,e}[2..-2]{b, c, d}Part( "Hello World!" , 1..7..2 )"HloW"
Pick all 2nd elements from the second level:
{{a1,a2}, {b1,b2}, {c1,c2}}[All, 2]{a2, b2, c2}
Part works on any expression.
Part( x^3+2*x+1 , 2, 1)2
gives True if all expressions expi are identical, and False otherwise.
Details
Same verify the expressions for exact correspondence and ignores the mathematical equality unlike Equal==.
Examples
x === yFalse
Integer 1 and Real 1.0 are not identical, but mathematically equal.
{ 1 === 1.0 , 1 == 1.0 }{False, True}
Overflows are identical, but the equality is unknown.
{ Overflow === Overflow , Overflow == Overflow }{True, Overflow == Overflow}
gives True if all expressions expi are mathematically unequal, and False otherwise.
Details
Unequal verify the expressions for mathematical inequality unlike Same===.
Examples
1 != 2True
Integer 1 and Real 1.0 are mathematically not unequal.
1 != 1.0False
All argument combination pairs must be unequal.
1 != 2 != 1FalseUnequal stays unevaluated if inequality is unknown.
a != ba != b