I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
COST (GBP)
this unit 2.81
sub units 0.30
+
0

depreciation

Return the depreciation for a specified period using the fixed-declining balance method. Excel: DDB
Controller: CodeCogs

add cart

Dependents

Info

Interface

C++
Excel

Depreciation

 
doubledepreciationdoublevalCost
doublevalSalv
intlife
intper
doublefact = 2.0 )
This function calculates the depreciation of an asset for a specified period. The method used is a fixed-declining method. This function is equivalent to the Microsoft Excel function DDB. It works on the following set of equations:

With two special cases, when period=1:

When period=life:

Where:
  • salv is the salvage value of the asset,
  • cost is the initial cost of the asset,
  • life is the number of periods over which the asset is being depreciated.
  • prevTot is the total depreciation from previous periods.

Example 1

#include <stdio.h>
#include <codecogs/finance/accounting/deprecfixeddec.h>
 
int main(void)
{
  double costVal=1000000;
  double salvVal=100000;
 
  printf("Consider an asset with the following terms:\n");
  printf("Cost\t\tSalvage\t\tLife\tPeriod\tMonth\tDepreciation\n");
 
  for (int per=1; per<=7; ++per) 
  { 
    printf("%f\t%f\t6\t%i\t7\t%f\n",
           costVal,
           salvVal,
           per,
           Finance::Accounting::deprecFixedDec(costVal, salvVal, 6, per, 7));
  }
 
  printf("\n");
  costVal=2500;
  salvVal=500;
  for (int per=1; per<=4; ++per) 
  { 
    printf("%f\t%f\t3\t%i\t6\t%f\n",
           costVal,
           salvVal,
           per,
           Finance::Accounting::deprecFixedDec(costVal, salvVal, 3, per, 6));
  }
 
  return 0;
}
Output:
Consider an asset with the following terms:
Cost            Salvage         Life    Period  Month   Depreciation
1000000.000000  100000.000000   6       1       7       186083.333333
1000000.000000  100000.000000   6       2       7       259639.416667
1000000.000000  100000.000000   6       3       7       176814.442750
1000000.000000  100000.000000   6       4       7       120410.635513
1000000.000000  100000.000000   6       5       7       81999.642784
1000000.000000  100000.000000   6       6       7       55841.756736
1000000.000000  100000.000000   6       7       7       15845.098474
 
2500.000000     500.000000      3       1       6       518.750000
2500.000000     500.000000      3       2       6       822.218750
2500.000000     500.000000      3       3       6       480.997969
2500.000000     500.000000      3       4       6       140.691906

References

http://www.vni.com/products/imsl/jmsl/v30/api/

Parameters

valCostThe initial cost of the asset.
valSalvThe salvage value of the asset at the end of its life.
lifeThe is the number of periods over which the asset is being depreciated (sometimes called the useful life of the asset).
perThe period for which you want to calculate the depreciation. per must have the same units as life.
factDefault Value = 2.0

Returns

The depreciation for each accounting period.

Authors

James Warren (August 2005)
Source Code

Source code is available when you buy a Commercial licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.