BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 10-02-2010, 09:00 AM   #1 (permalink)
New Member
 
Join Date: Sep 2010
Location: Canada
Model: 8330
PIN: N/A
Carrier: Telus
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default MathUtilities

Please Login to Remove!

I've made an attempt to understand and to convert formulas from my Excel application to the BlackBerry application that I'm working on, but I need input from someone with expertise in this area, to show me what I'm doing wrong.

Your assistance would be greatly appreciated. Thanks!!


(1) Excel Formula: =ROUND((1+PMIF)^12-1,4);
BB Formula: = MathUtilities.Round(1+PMIF),MathUtilities.Pow(12-1,4);


(2) Excel Formula: =((1+(AIR/2))^2)^(1/12)-1;
BB Formula: = (1+(AIR/2)), MathUtilities.Pow( ????.........


(3) Excel Formula: =(P*PIFM)/(1-(1+PIFM)^(-AMMO))..
BB Formula: = (P*PIFM)/(1-(1+PIFM), MathUtilities.Pow(-AMMO));

(4) Excel Formula: =ROUND(PPM,2);
BB Formula: = MathUtilities.Round(PPM,2);
Offline  
Old 10-02-2010, 06:05 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Well, MathUtilities.round() only takes one argument; MathUtilities.pow() requires two arguments . . .

I would suggest:
(1) Excel Formula: =ROUND((1+PMIF)^12-1,4);
IIRC the second argument to ROUND is the number of decimal palces
Code:
(float)MathUtilities.round( (MathUtilities.pow(1+PMIF,12)-1) * 10000 ) / 10000;

(2) Excel Formula: =((1+(AIR/2))^2)^(1/12)-1;
Code:
MathUtilities.pow(MathUtilities.pow( (1+(AIR/2)), 2), 1/12) - 1;

(3) Excel Formula: =(P*PIFM)/(1-(1+PIFM)^(-AMMO))..
Code:
(P*PIFM)/MathUtilities.pow(1-(1+PIFM), -AMMO);
(4) Excel Formula: =ROUND(PPM,2);
Code:
(float)MathUtilities.pow(PPM * 100) / 100;
__________________
My other Blackberry is a PlayBook.
Offline  
Old 10-02-2010, 07:11 PM   #3 (permalink)
New Member
 
Join Date: Sep 2010
Location: Canada
Model: 8330
PIN: N/A
Carrier: Telus
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks very much for your assistance.....Will implement the changes and let you know how the application works out.
Offline  
Closed Thread


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

1PC New FESTO MYH-5/3E-2,3-LED-SA 29847 Solenoid Valve
$199.99
1PC New FESTO MYH-5/3E-2,3-LED-SA 29847 Solenoid Valve picture1PC New FESTO CPE10-M1BH-5/3B-QS4-B 533151 Solenoid Valve
$131.99
1PC New FESTO CPE10-M1BH-5/3B-QS4-B 533151 Solenoid Valve picture1PC New FESTO CPE14-M1H-5L-QS-6 162912 Solenoid Valve
$189.99
1PC New FESTO CPE14-M1H-5L-QS-6 162912 Solenoid Valve picture1PC New FESTO MUFH-3-PK-3 6705 Solenoid Valve
$123.99
1PC New FESTO MUFH-3-PK-3 6705 Solenoid Valve picture1PC New FESTO CPA14-M1H-5/3-ES 173946 Solenoid Valve
$180.99
1PC New FESTO CPA14-M1H-5/3-ES 173946 Solenoid Valve picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.