BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 10-02-2010, 09:00 AM   #1
Alex McQuaid
New Member
 
Join Date: Sep 2010
Location: Canada
Model: 8330
PIN: N/A
Carrier: Telus
Posts: 10
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
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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
Alex McQuaid
New Member
 
Join Date: Sep 2010
Location: Canada
Model: 8330
PIN: N/A
Carrier: Telus
Posts: 10
Default

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



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


PRF Tubes (Platelet Rich Fibrin) , 10ml Glass,No Additives,EXP 2/2026 USA Seller picture

PRF Tubes (Platelet Rich Fibrin) , 10ml Glass,No Additives,EXP 2/2026 USA Seller

$219.99



C14 HT Dental Crystal Blocks Glass Ceramic Zirconia Reinforced CEREC Block CAD picture

C14 HT Dental Crystal Blocks Glass Ceramic Zirconia Reinforced CEREC Block CAD

$238.82



15 inch LCD  /pack of 2/G150XGE-L04  15 inch AUO TFT LCD Screen panel picture

15 inch LCD /pack of 2/G150XGE-L04 15 inch AUO TFT LCD Screen panel

$126.00



Yellow Jacket 49100 Gauge Crystal,Round, 3-1/8 In. picture

Yellow Jacket 49100 Gauge Crystal,Round, 3-1/8 In.

$7.55



Copper Sulfate Crystals 10lb Bag (FINE CRYSTAL) picture

Copper Sulfate Crystals 10lb Bag (FINE CRYSTAL)

$40.50



C14 HTA3 Dental Crystal Blocks Glass Ceramic Zirconia Reinforced CEREC Block CAD picture

C14 HTA3 Dental Crystal Blocks Glass Ceramic Zirconia Reinforced CEREC Block CAD

$238.82







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