Skip to content

Modern Finance RatePerPeriod

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

Home › Finance › Finance › RatePerPeriod

RatePerPeriod

Returns a quoted annual rate divided by its compounding periods, exactly.

Syntax

RatePerPeriod( nominalAnnual, compounding )

Examples

#import "std/money"
using money

'' The quoted annual rate divided by its compounding frequency.  EXACT --
'' a plain Decimal division, not reduced, so the claim below holds.
dim as Decimal j = DecimalParse( "0.0595" ).Value( )

print RatePerPeriod( j, COMPOUND_MONTHLY ).Value( ).ToString( )
print ( RatePerPeriod( j, COMPOUND_MONTHLY ).Value( ) = _
        ( j / DecimalFromInt( 12 ) ) )                    '' true, exactly

'' Simple interest has no per-period compounding to divide into, and
'' continuous has no "per period" at all -- a named refusal, not a
'' division by zero.
print RatePerPeriod( j, COMPOUND_SIMPLE ).Value( ).ToString( )              '' 0.0595
dim as boolean refused = _
    ( RatePerPeriod( j, COMPOUND_CONTINUOUS ).Failure( ).Code( ) = FIN_INVALID_BASIS )
print refused                                                              '' true

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

Clone this wiki locally