CASTI-89 TITANIUM · CALC89
when(
Returns one of several values depending on whether a condition is true, false or undecided. Used to define piecewise functions in a single line.
Syntax
when(condition, trueValue[, falseValue[, unknownValue]])
- Group
- Algebra
- Arguments
- Takes the condition, the value for true, and optionally the value for false and the value for an undecided condition.
- Availability
- Included
Example
| Input | Result |
|---|---|
| when(x>0,1,-1)|x=2 | 1 |
Typing when(x>0,1,-1)|x=2 on the home screen and pressing ENTER returns 1.
Related commands
- zeros(Returns the real values of the variable that make an expression zero, as a list.
- approx(Evaluates an expression numerically and returns a decimal approximation, even when the calculator is in exact mode.
- cFactor(Factors an expression over the complex numbers, so factors with non-real coefficients such as x+ⅈ are allowed.
- comDenom(Combines a sum of fractions into one reduced fraction over a common denominator.
- completeSquare(Rewrites a quadratic expression in completed square form.
- cPolyRoots(Returns all roots of a polynomial as a list, including non-real complex roots.
- cSolve(Solves an equation over the complex numbers and returns both real and non-real solutions.
- cZeros(Returns the real and non-real zeros of an expression as a list.