techPowerUp! Forums

Go Back   techPowerUp! Forums > Software > Programming & Webmastering

Reply
 
Thread Tools
Old Dec 3, 2012, 02:47 PM   #1
3870x2
3500 Posts
 
3870x2's Avatar
 
Join Date: Feb 2008
Location: Joplin, Mo
Posts: 4,543 (2.37/day)
Thanks: 175
Thanked 691 Times in 557 Posts
Send a message via Skype™ to 3870x2

System Specs

Cobol equation help!

I need help getting a mortgage calculation working on COBOL, the image has what I need exactly, and this is what I have currently:

Code:
               COMPUTE M ROUNDED = P * ( R / 12 ) -
               ( P * (( R / 12)/( 1 - ( 1 + R / 12 )**(12 * N))))
Where M = monthly payment, P = principal, R = rate (IE 0900 = 9%) and N = number of years.

I must be getting a small number, I get 0 for M unless I enter very large numbers (IE P=999,999,999, N=99 years, and R=99%)



Well, that was a rather large image. It was taken on my phone.
__________________
A+, N+, S+, MCSE.
Heatware
STEAM ID Name: furi0nst0rmrage (0s are zeros)
M O D E R N||W A R F A R E || 2 || CLUBHOUSE // TEAM
The amount exaltation of the processor cores can brings amazing floating” -sparkle

Last edited by 3870x2; Dec 3, 2012 at 04:45 PM.
3870x2 is offline  
Reply With Quote
Old Dec 3, 2012, 08:46 PM   #2
Drone
1000 Posts
 
Drone's Avatar
 
Join Date: Sep 2010
Location: Nonlocal location
Posts: 1,897 (1.90/day)
Thanks: 62
Thanked 822 Times in 525 Posts

System Specs

Honestly I have no idea about COBOL nor mortgage but that formula seems wrong. Place where blah ^12*N. It's gotta be blah ^-12*N. Maybe that's why you get wrong answer.

__________________
...the young Universe was filled with a hot dense soup of interacting protons, electrons and photons at about 2700ºC. When the protons and electrons joined to form hydrogen atoms, the light was set free
Drone is offline  
Reply With Quote
The Following User Says Thank You to Drone For This Useful Post:
Old Dec 4, 2012, 01:17 PM   #3
3870x2
3500 Posts
 
3870x2's Avatar
 
Join Date: Feb 2008
Location: Joplin, Mo
Posts: 4,543 (2.37/day)
Thanks: 175
Thanked 691 Times in 557 Posts
Send a message via Skype™ to 3870x2

System Specs

I have fixed it, my equation was correct, but the values that I entered were going in as 9000% instead of 9%. The answer I was getting was monthly payment = 0, so I thought that it was too low, it turns out that at 9000% the number was quite large, and the numbers were getting concatenated to be 0 when the number came out to be millions, but there was only room for 9999.99.
__________________
A+, N+, S+, MCSE.
Heatware
STEAM ID Name: furi0nst0rmrage (0s are zeros)
M O D E R N||W A R F A R E || 2 || CLUBHOUSE // TEAM
The amount exaltation of the processor cores can brings amazing floating” -sparkle
3870x2 is offline  
Reply With Quote
Old Dec 4, 2012, 02:43 PM   #4
Drone
1000 Posts
 
Drone's Avatar
 
Join Date: Sep 2010
Location: Nonlocal location
Posts: 1,897 (1.90/day)
Thanks: 62
Thanked 822 Times in 525 Posts

System Specs

I see now. There are so many different mortgage formulas. Good to know you've fixed that.
__________________
...the young Universe was filled with a hot dense soup of interacting protons, electrons and photons at about 2700ºC. When the protons and electrons joined to form hydrogen atoms, the light was set free
Drone is offline  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Equation solving in c++ caleb Programming & Webmastering 2 Mar 17, 2011 05:47 AM
Valve Inflicts European Gamers with $1 = €1 Equation btarunr News 196 Jan 5, 2009 01:19 PM
Help!help! Help Me Oc With 3way Sli Gtx280 Korn NVIDIA 4 Sep 12, 2008 04:28 AM
Help!Help!Help me oc Q6600 B3 with asus P5n-t delluxe Korn Motherboards & Memory 5 Sep 11, 2008 10:32 PM
Help!Help!who can help me to flash bios for Gtx260 Korn NVIDIA 2 Sep 7, 2008 05:48 AM


All times are GMT. The time now is 12:58 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
no new posts