|
|
Archives of the TeradataForum
Message Posted: Mon, 16 Feb 2015 @ 09:35:02 GMT
Subj: | | Re: Casting to integer with ** operator resulting incorrect |
|
From: | | Shada, Santhosh Reddy |
Exponentiation is a floating point operation which produces an inexact result.
In order to avoid systematic inaccuracies, sometimes it produces a number greater than the exact result, sometimes less than the exact result.
The conversion from float to integer is dictated by the SQL standard to be a truncation operation. When the inexact result is less than the exact
integer
result, this truncation produces an unexpected result. However, this is the logical result of providing accuracy and confomance to the
standard.
Thanks,
Santosh
| |