I am creating a scientific application that executes many crunch numbers in Java and C, and accuracy is critical. There are no crunches in the Oracle database (it is simply used to store variables between mathematical calculations).
I used a double-precision data type for all Java and C variables, which are largely based on IEEE 754. Thus, data written to a database and then read from a database is precision data types in C or Java.
What would you recommend using NUMBER or BINARY DOUBLE to store dual access data in Oracle?
For example, suppose I have a variable named X_Java that I write to the database as an X_DB variable as a BINARY DOUBLE. If I read this data in Java from a database and X_Java2 it in the variable X_Java2 , would X_Java exactly match X_Java2 ?
How will everything change, I saved X_DB in the database as NUMBER?
UPDATE 1: Please note that my criterion for "accuracy" is how close the number read from the database matches the amount that was available before it was written to the database.
On the one hand, I think that if the number available before it is written to the database is based on IEEE 754, then the data type used to store this value INSIDE the database should be accurate if this data type was also based on IEEE 754.
On the other hand, since a 64-bit number (double precision) can accurately store up to 16 (sometimes 17) precision digits, for storing in the form of NUMBERS in a database with 38 precision digits it should be accurately displayed to double precision. One of the drawbacks is that the NUMBER data type cannot store as large (or as small) values โโas BINARY DOUBLE.
So my message.
source share