summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
commitfecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch)
tree6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/mymoney/mymoneyfinancialcalculator.cpp
parentdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff)
downloadkmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz
kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/mymoney/mymoneyfinancialcalculator.cpp')
-rw-r--r--kmymoney2/mymoney/mymoneyfinancialcalculator.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp b/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp
index d6686a6..33d5855 100644
--- a/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp
+++ b/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp
@@ -86,8 +86,8 @@ MyMoneyFinancialCalculator::MyMoneyFinancialCalculator()
setPmt(0.0);
setFv(0.0);
- // clear the mask
- m_mask = 0;
+ // clear the tqmask
+ m_tqmask = 0;
}
MyMoneyFinancialCalculator::~MyMoneyFinancialCalculator()
@@ -122,38 +122,38 @@ void MyMoneyFinancialCalculator::setDisc(const bool disc)
void MyMoneyFinancialCalculator::setIr(const FCALC_DOUBLE ir)
{
m_ir = ir;
- m_mask |= IR_SET;
+ m_tqmask |= IR_SET;
}
void MyMoneyFinancialCalculator::setPv(const FCALC_DOUBLE pv)
{
m_pv = pv;
- m_mask |= PV_SET;
+ m_tqmask |= PV_SET;
}
void MyMoneyFinancialCalculator::setPmt(const FCALC_DOUBLE pmt)
{
m_pmt = pmt;
- m_mask |= PMT_SET;
+ m_tqmask |= PMT_SET;
}
void MyMoneyFinancialCalculator::setNpp(const FCALC_DOUBLE npp)
{
m_npp = npp;
- m_mask |= NPP_SET;
+ m_tqmask |= NPP_SET;
}
void MyMoneyFinancialCalculator::setFv(const FCALC_DOUBLE fv)
{
m_fv = fv;
- m_mask |= FV_SET;
+ m_tqmask |= FV_SET;
}
FCALC_DOUBLE MyMoneyFinancialCalculator::numPayments(void)
{
- const unsigned short mask = PV_SET | IR_SET | PMT_SET | FV_SET;
+ const unsigned short tqmask = PV_SET | IR_SET | PMT_SET | FV_SET;
- if((m_mask & mask) != mask)
+ if((m_tqmask & tqmask) != tqmask)
throw new MYMONEYEXCEPTION("Not all parameters set for calculation of numPayments");
FCALC_DOUBLE eint = eff_int();
@@ -162,15 +162,15 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::numPayments(void)
CC = (CC - m_fv) / (CC + m_pv);
m_npp = (CC > 0.0) ? logl (CC) / logl (eint +1.0) : 0.0;
- m_mask |= NPP_SET;
+ m_tqmask |= NPP_SET;
return m_npp;
}
FCALC_DOUBLE MyMoneyFinancialCalculator::payment(void)
{
- const unsigned short mask = PV_SET | IR_SET | NPP_SET | FV_SET;
+ const unsigned short tqmask = PV_SET | IR_SET | NPP_SET | FV_SET;
- if((m_mask & mask) != mask)
+ if((m_tqmask & tqmask) != tqmask)
throw new MYMONEYEXCEPTION("Not all parameters set for calculation of payment");
FCALC_DOUBLE eint = eff_int();
@@ -180,15 +180,15 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::payment(void)
m_pmt = -rnd((m_fv + m_pv * (AA + 1.0)) / (AA * BB));
//m_pmt = -floorl((m_fv + m_pv * (AA + 1.0)) / (AA * BB));
- m_mask |= PMT_SET;
+ m_tqmask |= PMT_SET;
return m_pmt;
}
FCALC_DOUBLE MyMoneyFinancialCalculator::presentValue(void)
{
- const unsigned short mask = PMT_SET | IR_SET | NPP_SET | FV_SET;
+ const unsigned short tqmask = PMT_SET | IR_SET | NPP_SET | FV_SET;
- if((m_mask & mask) != mask)
+ if((m_tqmask & tqmask) != tqmask)
throw new MYMONEYEXCEPTION("Not all parameters set for calculation of payment");
FCALC_DOUBLE eint = eff_int();
@@ -197,15 +197,15 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::presentValue(void)
m_pv = rnd(-(m_fv + (AA * CC)) / (AA + 1.0));
- m_mask |= PV_SET;
+ m_tqmask |= PV_SET;
return m_pv;
}
FCALC_DOUBLE MyMoneyFinancialCalculator::futureValue(void)
{
- const unsigned short mask = PMT_SET | IR_SET | NPP_SET | PV_SET;
+ const unsigned short tqmask = PMT_SET | IR_SET | NPP_SET | PV_SET;
- if((m_mask & mask) != mask)
+ if((m_tqmask & tqmask) != tqmask)
throw new MYMONEYEXCEPTION("Not all parameters set for calculation of payment");
FCALC_DOUBLE eint = eff_int();
@@ -213,7 +213,7 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::futureValue(void)
FCALC_DOUBLE CC = _Cx(eint);
m_fv = rnd(-(m_pv + AA * (m_pv + CC)));
- m_mask |= FV_SET;
+ m_tqmask |= FV_SET;
return m_fv;
}
@@ -260,7 +260,7 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::interestRate(void)
}
while (ri);
}
- m_mask |= IR_SET;
+ m_tqmask |= IR_SET;
m_ir = rnd(nom_int(eint) * 100.0);
return m_ir;
}