My default compile parameters for SQLRGPLE programs are set to DECFLTRND(*HALFEVEN). Even my IBM i SQL Scripts sessions are set to the same setting.
That being said, when I perform a division or multiplication calculation using sql, and I encase the calculation in a round() function, shouldn't the rounding rules use *HALFEVEN, or is that for DECFLOAT datatypes only?
My understanding of *HALFEVEN is, if the result field is a numeric(3,2) and the raw value is 1.146, then because the .14 is even, then it will not round the raw value to 1.15. However, it seems our system is always rounding. Then I thought maybe the *HALFEVEN rounding is being done without the round() function. But I am wrong on that as well.
What am I getting wrong with the SQL option to round using *HALFEVEN?
That being said, when I perform a division or multiplication calculation using sql, and I encase the calculation in a round() function, shouldn't the rounding rules use *HALFEVEN, or is that for DECFLOAT datatypes only?
My understanding of *HALFEVEN is, if the result field is a numeric(3,2) and the raw value is 1.146, then because the .14 is even, then it will not round the raw value to 1.15. However, it seems our system is always rounding. Then I thought maybe the *HALFEVEN rounding is being done without the round() function. But I am wrong on that as well.
What am I getting wrong with the SQL option to round using *HALFEVEN?
Comment