KSpread::ValueCalc Class Reference
The ValueCalc class is used to perform all sorts of calculations. More...
#include <valuecalc.h>
Collaboration diagram for KSpread::ValueCalc:

Public Member Functions | |
ValueCalc (ValueConverter *converter) | |
KSpreadValue | add (const KSpreadValue &a, const KSpreadValue &b) |
KSpreadValue | sub (const KSpreadValue &a, const KSpreadValue &b) |
KSpreadValue | mul (const KSpreadValue &a, const KSpreadValue &b) |
KSpreadValue | div (const KSpreadValue &a, const KSpreadValue &b) |
KSpreadValue | pow (const KSpreadValue &a, const KSpreadValue &b) |
KSpreadValue | add (const KSpreadValue &a, double b) |
KSpreadValue | sub (const KSpreadValue &a, double b) |
KSpreadValue | mul (const KSpreadValue &a, double b) |
KSpreadValue | div (const KSpreadValue &a, double b) |
KSpreadValue | pow (const KSpreadValue &a, double b) |
KSpreadValue | log (const KSpreadValue &number, const KSpreadValue &base) |
KSpreadValue | log (const KSpreadValue &number, double base=10) |
KSpreadValue | ln (const KSpreadValue &number) |
KSpreadValue | sum (const KSpreadValue &range) |
int | count (const KSpreadValue &range) |
int | countA (const KSpreadValue &range) |
KSpreadValue | avg (const KSpreadValue &range) |
KSpreadValue | max (const KSpreadValue &range) |
KSpreadValue | min (const KSpreadValue &range) |
Protected Member Functions | |
KSpreadValue::Format | format (KSpreadValue::Format a, KSpreadValue::Format b) |
Protected Attributes | |
ValueConverter * | converter |
Detailed Description
The ValueCalc class is used to perform all sorts of calculations.No other means of calculation should be performed, to achieve transparency, and to ease addition of new datatypes.
Of course, for some functions, it might be impossible to apply them on all datatypes, but since all of them can be applied on both doubles and GnuMP-based numbers, that is not of much concern ;)
Definition at line 39 of file valuecalc.h.
Member Function Documentation
|
basic arithmetic operations
Definition at line 32 of file valuecalc.cc. References KSpread::ValueConverter::asFloat(), KSpreadValue::format(), format(), KSpreadValue::isNumber(), and KSpreadValue::setFormat(). Referenced by sum(). |
|
logarithms
Definition at line 155 of file valuecalc.cc. References KSpread::ValueConverter::asFloat(), KSpreadValue::errorDIV0(), KSpreadValue::errorNA(), and KSpreadValue::setFormat(). |
|
basic range functions
Definition at line 201 of file valuecalc.cc. References add(), KSpread::ValueConverter::asFloat(), KSpreadValue::columns(), KSpreadValue::element(), KSpreadValue::isArray(), KSpreadValue::rows(), and KSpreadValue::setFormat(). Referenced by KSpreadView::resultOfCalc(). |
|
return result formatting, based on these two values
Definition at line 349 of file valuecalc.cc. Referenced by add(). |
The documentation for this class was generated from the following files: