math « bigdecimal « Java Data Type Q&A





1. How to handle multiplication of numbers close to 1    stackoverflow.com

I have a bunch of floating point numbers (Java doubles), most of which are very close to 1, and I need to multiply them together as part of a larger calculation. ...

2. Java Math Functions for BigDecimal    stackoverflow.com

Are there complementary mathematical functions used in java.lang.Math that fully utilize the capabilities of BigDecimal? In other words, is there a log function that takes and returns a BigDecimal similar to ...

3. A more functionrich number (than Bigdecimal) holding java library    stackoverflow.com

  • The operation should try and keep the answer of the same type as the original inputs, thus if the holder started of with a Double then the result should also be ...

4. Get the Mantissa of a Java BigDecimal    stackoverflow.com

I want to do some simple math with some very small and very large numbers. I figured I'd start with BigDecimal:

scala> java.math.BigDecimal.valueOf(54, 45) 
res0: java.math.BigDecimal = 5.4E-44
How do I then get ...

5. How to get biggest BigDecimal value    stackoverflow.com

How can I get the largest possible value of a BigDecimal variable can hold? (Preferably programmatically, but hardcoding would be ok too) EDIT
OK, just realised there is no such thing since BigDecimal ...

6. Why do we need to convert the double into a string, before we can convert it into a BigDecimal?    stackoverflow.com

The source for round in apache commons looks like this:

public static double round(double x, int scale, int roundingMethod) {
    try {
       ...

7. Java Number/Maths Abstraction    stackoverflow.com

I'm currently in the process of writing an application that has quite a number of mathematically calculations in it. In some situations, these calculations need to be done quickly and we ...





10. Math.exp with BigDecimal    forums.oracle.com

11. java.math.BigDecimal;    forums.oracle.com

12. Cast to a literal (ex. "java.math.BigDecimal")    forums.oracle.com

You could do this by reflection for classes which have a contructor which takes an single string parameter - which I believe all these classes do. Lot's of messy expections to field. The sequence would be something like: [code] private static Object create(String[] columns) throws Exception { Class clazz = Class.forName(columns[0]); // get the class Contstructor cons = clazz.getConstructor(new Class[]{String.class}); // ...