FIX: Several fixes on the FV function
(1+x)^(1+y) was stringifyfied incorrectly We still need work on this FV now returns currency FV(-1,-2,1) should return #DIV/0! not #NUM!
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
8c6aaf2af0
commit
23814ec18c
@@ -89,6 +89,9 @@ fn compute_future_value(
|
||||
if rate == 0.0 {
|
||||
return Ok(-pv - pmt * nper);
|
||||
}
|
||||
if rate == -1.0 && nper < 0.0 {
|
||||
return Err((Error::DIV, "Divide by zero".to_string()));
|
||||
}
|
||||
|
||||
let rate_nper = (1.0 + rate).powf(nper);
|
||||
let fv = if period_start {
|
||||
|
||||
Reference in New Issue
Block a user