Archives of the TeradataForum
Message Posted: Mon, 16 Feb 2015 @ 09:49:50 GMT
Difference between cast to integer and cast to decimal decimal is a result of general rule:
Truncation and Rounding During Conversion
Conversion of DECIMAL/NUMERIC to BIGINT, INTEGER, BYTEINT, or SMALLINT
truncates any decimal portion. Conversion to DECIMAL produces a rounded result.
Difference between power function and operator: function is Oracle-compatible and returns type NUMBER ( for integer arguments), operator always returns float and arguments are converted to float before calculation.
If you use power function with float arguments, you will get result type float with the same value:
sel cast( power( 10(float) , 4(float) ) as integer ) : 9999
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|