Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
Posts: 138
Registered: ‎07-11-2010
My Device: Bold 9700
My Carrier: O2

BigDecimal equivalent?

Does anyone know of an equivalent class to BigDecimal? I just need something like it for developing BB apps
Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: BigDecimal equivalent?

[ Edited ]

I've never found anything like it in the RIM api.

 

You might take a look at gmp, ntl (C and C++, respectively) or the source for java.math.BigNum or BigDecimal in J2SE. Nothing is going to be easy to port to BB.

 

[Or look at rmaniac25's answer, since he's better informed than me about this.]




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.
Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: BigDecimal equivalent?

[ Edited ]

I have, it requires signing but it's good.

 

net.rim.device.api.crypto.CryptoInteger

net.rim.device.api.crypto.CryptoByteArrayArithmetic

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 498
Registered: ‎06-24-2008
My Device: Not Specified

Re: BigDecimal equivalent?

Those appear to be integer based so still leaves work to do plus as stated it requires additional licenses.

 

There's net.rim.device.api.math.Fixed32 (still pretty limited).

 

Migrating BigDecimal etc isn't hard - just a fair amount of work.

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: BigDecimal equivalent?

Well RIM owns Certicom so you can request the extra key for free, you have it if you got your key within (I think) the last year. In 6.0 they removed the need for the Certicom key (probably because many should already have it or they can request it or they just removed it).

 

I missed the "Decimal" part of BigDecimal.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: BigDecimal equivalent?

I guess if you start with the J2SE 1.4 version of BigDecimal it isn't as much work. After that, you need to deal with porting enums, generics, and some other nuisances (not to mention sorting out what's deprecated and unnecessary from deprecated and still needed.)




Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.