|
Hans, you're absoulutely right about the result of an expression(surprise). The manual actually says "Result Decimal Position precision rules apply only to packed decimal intermediate results." Missed the word "intermediate." Adjectives do make a difference. <g> As my punishment, I'll quote the manual's brief description of the default precision rule: "Using the default precision rule, the precision of a decimal intermediate in an expression is computed to minimize the possibility of numeric overflow. However, if the expression involves several operations on large decimal numbers, the intermediates may end up with zero decimal positions. (Especially, if the expression has two or more nested divisions.) This may not be what the programmer expects, especially in an assignment. When determining the precision of a decimal intermediate, two steps occur: 1. The desired or "natural" precision of the result is computed. 2. If the natural precision is greater than 30 digits, the precision is adjusted to fit in 30 digits. This normally involves first reducing the number of decimal positions, and then if necessary, reducing the total number of digits of the intermediate." > -----Original Message----- > From: boldt@ca.ibm.com [mailto:boldt@ca.ibm.com] > Sent: Monday, October 04, 1999 12:46 PM > To: RPG400-L@midrange.com > Subject: RE: [Re: RPGILE V4.3 Gotcha] > > > > /* Big Snip */ > > "...the result of the expression may only be a packed field."??? > Where does it say that in the manual? > > I thought the manual said that *RESDECPOS only applies to decimal > operations. *RESDECPOS is a solution for a problem that occurs > only for decimal numerics, and not for the other numeric data > types. > > +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.