The calculation for finding compound interest: newValue = originalValue * (1 + rate/cp)^(cp*t) : Math « Development « Flash / Flex / ActionScript

Flash / Flex / ActionScript
1. Animation
2. Array
3. Class
4. Data Type
5. Development
6. Function
7. Graphics
8. Language
9. Network
10. Regular Expressions
11. Statement
12. String
13. TextField
14. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Flash / Flex / ActionScript » Development » Math 
The calculation for finding compound interest: newValue = originalValue * (1 + rate/cp)^(cp*t)
 

cp is the number of compounding periods per year (12 if it is compounded every month)
t is the number of years. 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var nOrig: int 10;
        var nRate:int 2;
        var nCp: int 3;
        var nT: int 3;
        
        var nNew = nOrig * Math.pow((+ nRate/nCp)(nCp*nT));
        trace(nNew);
    }
  }
}

        
Related examples in the same category
1. Math Constants
2. Math Class Arithmetic
3. Math Class Trigonometry
4. Math class includes the constant Math.PI for the number, ratio of a circle's circumference to its diameter.
5. Finding Absolute Values
6. Rounding and Truncating Numbers: round(), ceiling(), and floor()
7. The ceil() method returns the next-highest integer value of the number passed it as an argument.
8. The floor()returns the next-lowest integer.
9. Use round(), ceiling(), and floor() to round or truncate to decimal place values.
10. Generating Random Numbers: The random() returns a floating-point value between 0 and 0.999999, inclusive.
11. Generate a random number within a range that does not start with 0
12. Random integer values
13. If you are working with one six-sided die, you want to generate a random number between 1 and 6 each time
14. Finding the Greater or Lesser of Two Numbers
15. package{
16. The exp() method requires one parameter: a number. It then raises e (Math.E) to the power of that number.
17. atan2(), takes two parameters (an X- and a Y-coordinate), and returns the angle formed by the right triangle measured in radians: Math.atan2(x, y)
18. Use Math.round( ) to round a number to the nearest integer
19. Use Math.floor( ) to round a number down
20. Use Math.ceil( ) to round a number up.
21. To round a number to the nearest decimal place:
22. Use the identical math to round a number to the nearest multiple of an integer.
23. All trig functions operate on radians, an angular unit in which radians measure a full revolution.
24. Generate random number in a range
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.