Teradata Data Type for exp+40 and exp-40 data

Database
Enthusiast

Teradata Data Type for exp+40 and exp-40 data

Hi All

 

We have a requirement where one field can have value between exp(-40) to exp(40) range.
We need a data type which can hold both values to their actual precision whithout any change/modification.

 

I tried using NUMBER(38,32) but that is working only for exp(-40)
Also, I tried using NUMBER(38,8) but that is working only for exp(40)

 

Need help to find only one common data type for both, please advise.

 

Thanking You

Santanu Ghosh


Accepted Solutions
Junior Contributor

Re: Teradata Data Type for exp+40 and exp-40 data

There's no datatype in Teradata which can store 40 digits of precision.

 

If you want to store a huge range of values you simply define NUMBER without precision, i.e. NUMBER or NUMBER(*) then it acts like a kind of super-float with 38 digits of precision.

1 ACCEPTED SOLUTION
5 REPLIES
Supporter

Re: Teradata Data Type for exp+40 and exp-40 data

check the manual on the difference between Numeric and Decimal.

Try Decimal(38,20)

Ulrich

Junior Contributor

Re: Teradata Data Type for exp+40 and exp-40 data

There's no datatype in Teradata which can store 40 digits of precision.

 

If you want to store a huge range of values you simply define NUMBER without precision, i.e. NUMBER or NUMBER(*) then it acts like a kind of super-float with 38 digits of precision.

Supporter

Re: Teradata Data Type for exp+40 and exp-40 data

OK - might be worth to clarfiy

My answer was interpreting the request to store the result of the exponatial funktion exp(40) and exp(-40).

exp(40) is 235385266837019985 and requires 18 digists.

exp(-40) is 1/235385266837019985

as the result of the exp funtion is a Real number neither Numeric nor Decimal can store all exp results between exp(-40) and exp(40) in full precission...But decimal(38,20) seems to work with the decimal limitations.

If the question is related to general 40 digits Dieters comment is clearly valid!

 

Enthusiast

Re: Teradata Data Type for exp+40 and exp-40 data

Thanks for your reply, I really appreciate that.

Enthusiast

Re: Teradata Data Type for exp+40 and exp-40 data

Thanks for your reply, I really appreciate that.