optimization « bigdecimal « Java Data Type Q&A

Home
Java Data Type Q&A
1.bigdecimal
2.biginteger
3.bit
4.Boolean
5.byte
6.Calendar
7.cast
8.character
9.Date Time
10.Date Time Format
11.decimal
12.Development
13.double
14.enum
15.float
16.hexadecimal
17.Integer
18.Number
19.Number Format
20.primitive
21.SimpleDateFormat
22.string
23.StringBuffer
24.StringBuilder
25.StringTokenizer
26.substring
27.TimeZone
Java Data Type Q&A » bigdecimal » optimization 

1. BigDecimal: Can the Java compiler optimize away multiplications by 1?    stackoverflow.com

Does the Java compiler remove multiplications by 1, when talking about BigDecimal? I'm standing in something similar to this:

BigDecimal bd = getBigDecimal();//get arbitrary bigDecimal, could be anyone.

bd = bd.multiply(new BigDecimal(getOneTwoOrThree());
Where the getOneTwoOrThree ...

2. Analog of StringBuilder for BigDecimal    stackoverflow.com

I've got a list of BigDecimals to sum. If they were Strings to concatenate, I would use StringBuilder to reduce object creation. Is there something similar for BigDecimal? Or maybe I ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.