|
|
Archives of the TeradataForum
Message Posted: Wed, 09 Oct 2002 @ 12:39:23 GMT
Subj: | | Re: Why isn't rounding working? |
|
From: | | Geoffrey Rommel |
| I presume 200/3 is an integer division which does not take remainder or fractions for this purpose into account. All the other
examples force a floating point division by one element being a real number. | |
Since two replies have said this, I thought I should note that 200.0 / 3 is not a floating-point operation. Consider this:
select type(200.0);
Type(200.0)
---------------------------------------
DECIMAL(4,1)
The parser considers 200.0 to be of type decimal(4,1), so it will perform a decimal division. Decimals are stored internally as
integers, and there is a DBS Control field that controls rounding (RoundHalfwayMagUp). I therefore infer that the rounding is done in
Teradata code, not in Pentium circuitry.
| |