

Archives of the TeradataForum
Message Posted: Tue, 01 Nov 2005 @ 15:10:45 GMT
Subj:   Re: Is FLOAT data type the right choice 

From:   Geoffrey Rommel 
 We have columns defined as DECIMAL(21,0) in the source system, but same cannot be implemented in Teradata. Is FLOAT is the right choice in
that case?  
You might search the archives, as this question has been discussed before. The fundamental point is this: decimal(18) uses 63 bits of
precision, whereas float uses 52 bits. Therefore, numbers above 2^52 = 4,503,599,627,370,496 cannot be represented precisely.
Is FLOAT the right choice in your case? If the numbers can be approximate (e.g., for decision support), probably yes. If the numbers need to be
represented exactly (e.g., for financial reporting), definitely not. In the latter case, you would have to split the number into two parts and
store it in two separate fields  perhaps decimal(15) and decimal(9).
 