1

I'm trying to insert a row value into a mysql table from a JAVA webapp. The table has a column "X" (which type is DOUBLE). I want to divide "A" (DOUBLE) and "B"(DOUBLE) and store the result in column "X" like this:

INSERT INTO myTable VALUES (DEFAULT, A/B)

Now, if for example A = 1 and B = 3, I store 0.33333..., or if A = 1000000 and B = 3, I store 333333.333...

My problem is when I want to get the original numerator, by doing B*(X value), only getting 0.9999... and 999999.9999...

We have also tried changing the number types to LONG, DECIMAL and FLOAT but we are not getting the exact result

How can we solve this?

Thanks!!

0 Answers0