kspread Library API Documentation

KSpread::ValueCalc Class Reference

The ValueCalc class is used to perform all sorts of calculations. More...

#include <valuecalc.h>

Collaboration diagram for KSpread::ValueCalc:

Collaboration graph
[legend]
List of all members.

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

ValueConverterconverter

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

KSpreadValue ValueCalc::add const KSpreadValue a,
const KSpreadValue b
 

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().

KSpreadValue ValueCalc::log const KSpreadValue number,
const KSpreadValue base
 

logarithms

Definition at line 155 of file valuecalc.cc.

References KSpread::ValueConverter::asFloat(), KSpreadValue::errorDIV0(), KSpreadValue::errorNA(), and KSpreadValue::setFormat().

KSpreadValue ValueCalc::sum const KSpreadValue range  ) 
 

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().

KSpreadValue::Format ValueCalc::format KSpreadValue::Format  a,
KSpreadValue::Format  b
[protected]
 

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:
KDE Logo
This file is part of the documentation for kspread Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:43:51 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003