MRFFL: MR Fortran Finance Library 2024-12-28
Computational Tools For Finance
|
Simple functions for working with percentages. More...
Functions/Subroutines | |
elemental real(kind=rk) function, public | percentage_to_fraction (p) |
Convert a percentage to a fraction. | |
elemental real(kind=rk) function, public | fraction_to_percentage (f) |
Convert a fraction to a percentage. | |
elemental real(kind=rk) function, public | percentage_of (v, p) |
Compute the percentage of a value. | |
elemental real(kind=rk) function, public | add_percentage (v, p) |
Add a percentage of a value to that value. | |
elemental real(kind=rk) function, public | percentage_change (v_from, v_to) |
Compute the percentage change. | |
elemental real(kind=rk) function, public | percentage_of_total (v_total, v_part) |
Compute the percentage of a total. | |
Simple functions for working with percentages.
elemental real(kind=rk) function, public mrffl_percentages::percentage_to_fraction | ( | real(kind=rk), intent(in) | p | ) |
Convert a percentage to a fraction.
Definition at line 54 of file mrffl_percentages.f90.
References percentage_to_fraction().
Referenced by mrffl_cashflows::add_intrest_to_cashflow_vector(), mrffl_cashflows::add_multi_intrest_to_cashflow_vector(), add_percentage(), mrffl_cashflows::cashflow_matrix_pv_fv_print(), mrffl_cashflows::cashflow_matrix_total_pv(), mrffl_cashflows::cashflow_vector_total_pv(), mrffl_cashflows::make_cashflow_vector_delayed_geometric_annuity(), percentage_of(), and percentage_to_fraction().
elemental real(kind=rk) function, public mrffl_percentages::fraction_to_percentage | ( | real(kind=rk), intent(in) | f | ) |
Convert a fraction to a percentage.
Definition at line 62 of file mrffl_percentages.f90.
References fraction_to_percentage().
Referenced by fraction_to_percentage(), percentage_change(), and percentage_of_total().
elemental real(kind=rk) function, public mrffl_percentages::percentage_of | ( | real(kind=rk), intent(in) | v, |
real(kind=rk), intent(in) | p ) |
Compute the percentage of a value.
Definition at line 70 of file mrffl_percentages.f90.
References percentage_of(), and percentage_to_fraction().
Referenced by mrffl_us_inflation::inf_aggregate(), percentage_of(), and mrffl_us_taxes::tax().
elemental real(kind=rk) function, public mrffl_percentages::add_percentage | ( | real(kind=rk), intent(in) | v, |
real(kind=rk), intent(in) | p ) |
Add a percentage of a value to that value.
Definition at line 79 of file mrffl_percentages.f90.
References add_percentage(), and percentage_to_fraction().
Referenced by add_percentage(), and mrffl_us_inflation::inf_adj().
elemental real(kind=rk) function, public mrffl_percentages::percentage_change | ( | real(kind=rk), intent(in) | v_from, |
real(kind=rk), intent(in) | v_to ) |
Compute the percentage change.
WARNING: We do not check to make sure that (v_to-v_from) is non-zero
Definition at line 89 of file mrffl_percentages.f90.
References fraction_to_percentage(), and percentage_change().
Referenced by mrffl_us_inflation::inf_aggregate(), and percentage_change().
elemental real(kind=rk) function, public mrffl_percentages::percentage_of_total | ( | real(kind=rk), intent(in) | v_total, |
real(kind=rk), intent(in) | v_part ) |
Compute the percentage of a total.
WARNING: We do not check to make sure that (v_total) is non-zero
Definition at line 99 of file mrffl_percentages.f90.
References fraction_to_percentage(), percentage_of_total(), and mrffl_config::zero_epsilon.
Referenced by mrffl_us_taxes::effective_tax_rate(), and percentage_of_total().