m (moved Calculator.framework to Calculate.framework) |
m (Calculator -> Calculate) |
||
Line 4: | Line 4: | ||
}} | }} | ||
The ''' | The '''Calculate''' framework provides a single function, <tt>CalculatePerformExpression</tt>, whose only purpose is to evaluate a mathematical expression in a string. The usage as same as the Mac OS X counterpart, and is documented in [http://code.google.com/p/undocumented-goodness/source/browse/trunk/UndocumentedGoodness/main.m]. | ||
== Recognized expressions == | == Recognized expressions == |
Latest revision as of 02:55, 23 September 2009
Calculate.framework | |
Private Framework | |
---|---|
Availabile | 2.0 – present |
Headers | [headers.cynder.me] |
The Calculate framework provides a single function, CalculatePerformExpression, whose only purpose is to evaluate a mathematical expression in a string. The usage as same as the Mac OS X counterpart, and is documented in [1].
Recognized expressions
- Binary operators:
- and, or, nor, xor, +, -, *, /, <<, >>
- Constants:
- pi
- Unary functions:
- sqrt, cbrt, exp, ln, log, sin, cos, tan, asin, acos, atan, sind, cosd, tand, asind, acosd, atand, sinh, cosh, tanh, asinh, acosh, atanh, ceil, floor, fabs, rint, lgamma, erf, erfc
- Binary functions:
- pow, fmod, hypot, rem
- Miscellaneous:
- x! (factorial), -x (unary minus)
Changing mode and precision in "runtime"
The evaluation mode can be changed in runtime with the integer, double and decimal keyword, e.g.
- integer 8/3 (returns 2)
The precision can be changed in runtime with precision=x, where 0 ≤ x ≤ 16.
Header