|
I am preparing a class on RPG IV for internal use, and was tinkering with the examples in the RPG Reference regarding intermediate precision. Straight from the reference, I have this: d fld1 s 15p 4 d fld2 s 15p 2 inz(4) d fld3 s 5p 2 inz(100) d fld4 s 9p 4 inz(1) d fld5 s 9p 4 inz(2) eval fld1=fld2/(((fld3/100)*fld4)+fld5) Of course, it returns 1.0000, exactly as expected. In an attempt to demonstrate (again, from the manual) that %DEC can be used to palliate this, I tried: eval fld2/(((fld3/100)*fld4)+fld5): %size(fld1): %decpos(fld1)) *RNF0329 30 The third parameter for %DEC or %DECH is not valid. Ah, well. That's too bad, because it would open a programmatic way to influence the intermediate calculations in the same way that re-ordering Traditional Operation Codes did - in essence, twisting the compiler's arm to use the intermediate results that *I* want. As it stands, I need to do this: eval fld2/(((fld3/100)*fld4)+fld5): %size(fld1): 4) Just an observation for anyone interested in intermediate precision, and detecting its results programmatically. --buck
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.