How to perform high precision calculations with mutable class in Java?

I am developing a tool using Java 6 that will read data from medical devices.

Each manufacturer of medical devices implements its own firmware / protocol. Suppliers (for example, I) write their own interface, which uses the manufacturer's firmware commands to receive data from a medical device. Most firmware will output data critically, so the provider receiving it must scale it by performing some calculations on it in order to understand the true value.

It is safe to assume that the accuracy of medical data is as important as the accuracy of financial data, etc.

I came to the conclusion that BigDecimal performs all the numerical calculations and saves the final value. I get a new data set almost every second, which means that I will perform calculations and update the same set of values ​​every second. Example: data from a fan for each breath.

Since BigDecimal is immutable, I worry about the number of objects generated on the heap every second. Moreover, the tool will have to scale to read data, giving 50 devices at the same time.

I can increase the heap size and all that, but still here are my questions ....

Questions

  • Is there any mutable BigDecimal cousin that I could use?

  • Is there any existing open-source infrastructure to do something like this?

  • Is Java the right language for this kind of function?

  • Apfloat? Apfloat . JScience?

  • Java,

  • . . , ?

+5
5

, , BigDecimal , . , . JVM .

+2

10 , , 16 .

0

double 16 , ? .

0

, 10 . , , 64- IEEE (Java double) 52 ( 16 ), , .

, . , Math.log() Math.exp() ( Math.log1p() Math.exp1m() , - , ).

0

, , , BigDecimal , - BigDecimal , .

0

All Articles