netPresentValue

package
v0.0.0-...-51e5f1b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2018 License: BSD-3-Clause Imports: 3 Imported by: 8

Documentation

Index

Constants

View Source
const IrrDefaultValue = -0.999999900
View Source
const IrrMinValue = -1.0

Variables

View Source
var BaseDate = Date(1899, 12, 30, 12, 0, 0, 0, UTC)

Functions

func NPV

func NPV(irrValue float64, payments []IPayment, firstPaymentDate *Time, daysInYear uint16) float64

NetPresentValue

func NPVDerivative

func NPVDerivative(irrValue float64, payments []IPayment, firstPaymentDate *Time, daysInYear uint16) float64

NetPresentValue derivative

func NPVSecondDerivative

func NPVSecondDerivative(irrValue float64, payments []IPayment, firstPaymentDate *Time, daysInYear uint16) float64

NetPresentValue second derivative

Types

type IPayment

type IPayment interface {

	//amount of payment
	Amount() float64

	//date of payment
	Date() *Time

	//True if current payment is before p
	Before(p IPayment) bool

	//True if current payment is after p
	After(p IPayment) bool

	//True if current payment is at the sane date as p
	SameDateAs(p IPayment) bool
}

Payment interface

type Payment

type Payment struct {
	// contains filtered or unexported fields
}

Basic implementation of Payment interface

func NewPayment

func NewPayment(amount float64, date Time) *Payment

func (*Payment) After

func (p *Payment) After(s IPayment) bool

func (*Payment) Amount

func (p *Payment) Amount() float64

func (*Payment) Before

func (p *Payment) Before(s IPayment) bool

func (*Payment) Date

func (p *Payment) Date() *Time

func (*Payment) SameDateAs

func (p *Payment) SameDateAs(s IPayment) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL