AccumulationTable

An iterative accumulation: starting from a seed, each row applies your function to the previous total. Columns are Step, Current Total, Change, and Next Total.

real compound(real x) { return x * 1.05; }   // 5% per period

AccumulationTable table = AccumulationTable(1000, 8, compound, "Compound Interest (5\%)");

Image img = Image();

img.width(18);

img.height(9);
img.padding(0.5);
img.add(table);

An accumulation table for compound interest

Methods

Method Purpose
AccumulationTable(seed=0, steps=10, func=identity, title="Accumulation Table") Build the table
set_title(title) Set the top header
set_step_header / set_accum_header / set_change_header / set_next_total_header(label) Rename a column
set_debug_mode(bool) Draw bounds

func has type real_function_1 (real(real)) and maps the current total to the next total.


Maximum Mathematics — created by Jacob Hiance.

This site uses Just the Docs, a documentation theme for Jekyll.