
Why worry about it RPG when you don't appear
to be worried about it Excel?
Given that Excel apparently stores numbers as floating
point and that there are differences between floating
point arithmetic and RPG's fixed decimal arithmetic...
expecting the same results is probably a fantasy.
Personally, I'd consider RPG's fixed decimal answer "right" over
Excel's floating point answer when dealing with real world values
especially for currency.
However, if you want to consider Excel's floating point
answer "right", it would behoove you to use floating
point variables in RPG to match.
The true "right" solution in my mind
1) use RPG fixed point
2) Understand RPG's fixed point precision rules
3) use %round() and/or %dec() as needed to control intermediate
results as you want.
This mailing list archive is Copyright 19972019 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].