summaryrefslogtreecommitdiff
path: root/calc.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-09-01 00:41:52 +0800
committerxuri <xuri.me@gmail.com>2022-09-01 00:41:52 +0800
commit75ce2317286181e2c250c10206df892278d5b981 (patch)
tree5e040d90cbb170a0cbdc0c6a57e0b86c7bc82845 /calc.go
parent18cd63a548afa1abcddc86a998fdefa3b4cc60c1 (diff)
This closes #1323, an error will be returned when set the not exist style ID
Diffstat (limited to 'calc.go')
-rw-r--r--calc.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/calc.go b/calc.go
index 25595d6..f6217a8 100644
--- a/calc.go
+++ b/calc.go
@@ -6037,7 +6037,7 @@ func getBetaHelperContFrac(fX, fA, fB float64) float64 {
bfinished = math.Abs(cf-cfnew) < math.Abs(cf)*fMachEps
}
cf = cfnew
- rm += 1
+ rm++
}
return cf
}
@@ -6914,7 +6914,7 @@ func (fn *formulaFuncs) CHIDIST(argsList *list.List) formulaArg {
for z <= x1 {
e = math.Log(z) + e
s += math.Exp(c*z - a - e)
- z += 1
+ z++
}
return newNumberFormulaArg(s)
}
@@ -6926,7 +6926,7 @@ func (fn *formulaFuncs) CHIDIST(argsList *list.List) formulaArg {
for z <= x1 {
e = e * (a / z)
c = c + e
- z += 1
+ z++
}
return newNumberFormulaArg(c*y + s)
}
@@ -15286,10 +15286,10 @@ func (fn *formulaFuncs) coupons(name string, arg formulaArg) formulaArg {
month -= coupon
}
if month > 11 {
- year += 1
+ year++
month -= 12
} else if month < 0 {
- year -= 1
+ year--
month += 12
}
day, lastDay := maturity.Day(), time.Date(year, time.Month(month), 1, 0, 0, 0, 0, time.UTC)