This shows you the differences between two versions of the page.
expressions [2016/02/28 15:31] Wearable Software |
expressions [2021/02/17 21:40] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Expressions ====== | ||
- | |||
- | ===== Built-in operators ===== | ||
- | * Addition: 2 + 2 | ||
- | * Subtraction: | ||
- | * Multiplication: | ||
- | * Division: 2 / 2 | ||
- | * Exponentation: | ||
- | * Unary Minus,Plus (Sign Operators): +2 - (-2) | ||
- | * Modulo: 2 % 2 | ||
- | |||
- | ===== Mathematical Functions ===== | ||
- | You can also use mathematical functions for your expression. These expressions are supported: | ||
- | |||
- | * abs: absolute value | ||
- | * acos: arc cosine | ||
- | * asin: arc sine | ||
- | * atan: arc tangent | ||
- | * cbrt: cubic root | ||
- | * ceil: nearest upper integer | ||
- | * cos: cosine | ||
- | * cosh: hyperbolic cosine | ||
- | * exp: euler' | ||
- | * floor: nearest lower integer | ||
- | * log: logarithmus naturalis (base e) | ||
- | * log10: logarithm (base 10) | ||
- | * log2: logarithm (base 2) | ||
- | * sin: sine | ||
- | * sinh: hyperbolic sine | ||
- | * sqrt: square root | ||
- | * tan: tangent | ||
- | * tanh: hyperbolic tangent | ||
- | |||
- | ==== Example ==== | ||
- | < | ||
- | Returns the integer value for the current temperature | ||
- | |||
- | ====== Conditional statements | ||
- | You can use condition statements in expressions to build dynamic watchfaces. The syntax for a conditional statement is: | ||
- | |||
- | < | ||
- | |||
- | Following operators are supported for a condition: | ||
- | * greater equal >= | ||
- | * lower equal <= | ||
- | * lower < | ||
- | * greater > | ||
- | * equals == | ||
- | * not equals != | ||
- | |||
- | ===== Example ===== | ||
- | |||