Kth Context
Contexts are the main entrypoint of the Karith API. Their primary function is to parse strings into expressions, which can then be calculated to obtain a result.
A context defines a certain set of operators, functions and constants that can be used in expressions.
A context can be built using the KthContext method, or by copying an existing context like KthContext.
You can parse a string into an expression using the parseExpression or parseExpressionWith method. Then you can calculate the expression's result using the KthExpression.calculateResult method.
A default context KthContext is available. Functions from this class can be used directly without having to create a context: the default context will be used.
Inheritors
Types
Builder interface for KthContext.
A default context that includes Modules.BASE, Modules.MATH and Operators.POWER.
Functions
Parses an arithmetic expression from the receiving string, then return its result.
Parses an arithmetic expression from the given string, then return its result.
Parses an arithmetic expression from the receiving string, then return its result.
Parses an arithmetic expression from the given string, then return its result.
Clears the expression cache of the context.
Copies this context to create a new context containing the same elements.
Parses an arithmetic expression from the receiving string.
Parses an arithmetic expression from the given string.
Parses an arithmetic expression from the receiving string and given declared variables.
Parses an arithmetic expression from the given string and declared variables.