Jitesh Dani
Jitesh Dani

Reputation: 385

DB2 Double Datatype

In one of my tables in DB2, I see the column datatype as double as length 8.

How many decimals precision would this column have?

(There is one other data type DECIMAL where I can specify the length 8 and precision)

What about double?

Upvotes: 2

Views: 14320

Answers (2)

Jonathan Leffler
Jonathan Leffler

Reputation: 754280

And the other bit of information (compared with DrJokepu's answer) is that because it is IEEE 754 double precision, you can get about 16 (some will claim 17) decimal digits. However, be aware of all the issues of floating point accuracy. Generally, it is a bad idea to use DOUBLE for monetary quantities in accounting packages (but it might be OK for fantasy games like the US budget, where balancing isn't critical).

Upvotes: 3

Tamas Czinege
Tamas Czinege

Reputation: 121354

According to the DB2 reference:

Double-precision floating-point (DOUBLE or FLOAT)

A double-precision floating-point number is a 64-bit approximation of a real number. The number can be zero or can range from -1.79769E+308 to -2.225E-307, or from 2.225E-307 to 1.79769E+308.

Upvotes: 2

Related Questions