Crate rfinancial

Crate rfinancial 

Source
Expand description

§rfinancial

rfinancial is a financial crate mimicking numpy_financial in Python.

§Initial Working Version

  • fv - future value
  • pmt - payment against loan principal plus interest
  • nper - number of periodic payments
  • ipmt - interest portion of a payment
  • ppmt - payment against loan principal
  • pv - present value
  • rate - rate of interest per period
  • irr - internal rate of return
  • npv - net present value of a cash flow series
  • mirr - modified internal rate of return

§To Be Added

  • amortization

§Tests

  • All test cases are tested against numpy_financial’s result with some exceptions
  • numpy_financial has some its own issues

§Example

You will find example in each module page

use rfinancial::*;
let fv = FutureValue::from_tuple((0.075, 20, -2000.0, 0.0, WhenType::End));
println!("{:#?}'s fv is {:?}", fv, fv.get());

§Future Work

  • Add more functions
  • Add more test cases

§Contribution

  • Use the crate and feedback
  • Submit pull request or issues though the GitHub repository

Structs§

FutureValue
Compute the future value
InterestPayment
Compute the interest portion of a payment
InternalRateReturn
Compute the Internal Rate of Return (IRR)
ModifiedIRR
Compute the Modified Internal Rate of Return (MIRR)
NetPresentValue
Compute the net present value of a cash flow, given an interest rate
NumberPeriod
Compute the number of periodic payments
ParaError
Payment
Compute the payment against loan principal plus interest
PresentValue
Compute the present value
PrincipalPayment
Compute the payment against loan principal
Rate
Compute the interest rate

Enums§

Error
ParaType
Parameter types in a enum
WhenType
when payments are due in a payment period

Constants§

ATOL
Tolerance of absolute difference
RTOL
Tolerance of relative difference

Functions§

float_close
To compare if two f64 are close enough to be treated as equal
get_f64
get_u32
get_vecf64
get_when

Type Aliases§

ParaMap
Result