![]() |
|
Archives of the TeradataForumMessage Posted: Sun, 15 Feb 2015 @ 15:20:54 GMT
Hi Forum, Power and ** function are results float data typed values. ## power(x, y): upon working function CAST to integer data type, it results correct. ## x**y : upon working function CAST to integer, it is resulting incorrect. test case:
select cast(power(10,4) as integer); res: 10000
select cast((10**4) as integer); res: 9999
however it works when we use double cast through decimal,
select cast(cast((10**4) as decimal(20,0))as integer); res: 10000
Could anyone help me understand why this is happening ,is there any implicit conversion going on here. Thanks, Sandeep. GANGA SANDEEP KUMAR
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||