Skip to content

Modern Finance CompoundAnnualGrowthRate

Paul Squires edited this page Oct 19, 2026 · 4 revisions

Home › Finance › Finance › CompoundAnnualGrowthRate

CompoundAnnualGrowthRate

Returns the steady yearly rate that grows a starting value to an ending value.

Syntax

CompoundAnnualGrowthRate( beginValue, endValue, years )

Examples

#import "std/money"
using money

'' The single annual rate that turns the opening value into the closing
'' one over the term -- a fractional root, so the double kernel.
var c = CompoundAnnualGrowthRate( DecimalParse( "1000" ).Value( ), _
                                  DecimalParse( "2000" ).Value( ), 5.0 )
print c.Value( )                         '' 0.148698354997035

'' Its definition, checked by substitution: growing at that rate for the
'' whole term reproduces the ending value.
print 1000.0 * ( ( 1.0 + c.Value( ) ) ^ 5.0 )            '' 1999.999999999999 -- 2000, to double precision

'' A zero or negative starting value has no growth rate.
print CompoundAnnualGrowthRate( DecimalZero( ), DecimalFromInt( 10 ), 5.0 ).Failure( ).Message( )

Library: Finance
Category: Finance
Documented under: Nothing Becomes A Keyword
Source: pkg/std/money/finport.tiko in the tiko repository.

Clone this wiki locally