Skip to content

Commit 74675ed

Browse files
evanknapkeMTjcoliz
authored andcommitted
Remove incorrect checks for PMT and FV calculations
1 parent 0af8f7c commit 74675ed

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/ExcelFinancialFunctions/testpreconditions.fs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ module internal TestPreconditions =
1818
( pmt <> 0. || fv <> 0. )
1919
let tryFv r nper pmt pv pd =
2020
( raisable r nper) &&
21-
( r <> -1. || (r = -1. && nper > 0.) ) &&
22-
( pmt <> 0. || pv <> 0. )
21+
( r <> -1. || (r = -1. && nper > 0.) )
2322
let tryPmt r nper pv fv pd =
2423
( raisable r nper) &&
2524
( r > -1. ) &&
26-
( fv <> 0. || pv <> 0. ) &&
2725
( annuityCertainPvFactor r nper pd <> 0. )
2826
let tryNper r pmt pv fv pd =
2927
( r > -1.) &&

src/ExcelFinancialFunctions/tvm.fs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ module internal Tvm =
2828
let calcFv r nper pmt pv pd =
2929
( raisable r nper) |> elseThrow "r is not raisable to nper (r is negative and nper not an integer"
3030
( r <> -1. || (r = -1. && nper > 0.) ) |> elseThrow "r cannot be -100% when nper is <= 0"
31-
( pmt <> 0. || pv <> 0. ) |> elseThrow "pmt or pv need to be different from 0"
3231
if r = -1. && pd = PaymentDue.BeginningOfPeriod then - (pv * fvFactor r nper)
3332
elif r = -1. && pd = PaymentDue.EndOfPeriod then - (pv * fvFactor r nper + pmt)
3433
else fv r nper pmt pv pd
3534
let calcPmt r nper pv fv pd =
3635
( raisable r nper) |> elseThrow "r is not raisable to nper (r is negative and nper not an integer"
37-
( fv <> 0. || pv <> 0. ) |> elseThrow "fv or pv need to be different from 0"
3836
( r <> -1. || (r = -1. && nper > 0. && pd = PaymentDue.EndOfPeriod) ) |> elseThrow "r cannot be -100% when nper is <= 0"
3937
( annuityCertainPvFactor r nper pd <> 0. ) |> elseThrow "1 * pd + 1 - (1 / (1 + r)^nper) / nper has to be <> 0"
4038
if r = -1. then -fv

0 commit comments

Comments
 (0)