× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: [Re: RPGILE V4.3 Gotcha]
  • From: Jim Langston <jlangston@xxxxxxxxxxxxxxxx>
  • Date: Tue, 05 Oct 1999 10:43:01 -0700
  • Organization: Conex Global Logistics Services, Inc.

Most people use RPG and the AS/400 for businesses, right?  And most
businesses are in the bussiness of making money, right?  And money is
counted in dollars and cents, which contains 2 decimal places.  So a good
majority of the numbers on any given AS/400 system are going to have
2 fixed decimal places, right?

Basic introduced a currency value, which is actually an integer treated as
a 2 fixed place real number.

The whole problem, as I see it, is that what the majority of the use eval is
going to be used for in mathematics is going to be for simple money
calculations.  Not all, by any means, but the vast majority.  So a very good
portion of any math done in EVAL will be with 2 fixed decimal places,
and the concern for overflow is not going to be there.

But, the question still stands, how many people knew that this was the
way Eval worked before this topic was brought up?  I am daring to say
almost none, except for the people who wrote the compiler.

Regards,

Jim Langston

"Eric N. Wilson" wrote:

> Note he said for fixed precision decimal values. Not the IEEE floating point
> values which are the apples to apples comparison between RPG and other
> languages. I think the problem comes from a bit of miscommunication.
>
> Eric
> ______________________________________________________________
>
>  ----- Original Message -----
> From: Jim Langston <jlangston@conexfreight.com>
> To: <RPG400-L@midrange.com>
> Sent: Tuesday, October 05, 1999 7:30 AM
> Subject: Re: [Re: RPGILE V4.3 Gotcha]
>
> > What's to understand?  From all the discussion I have read here, and
> > from someone quoting the manual, if you use eval you can LOOSE all
> > your decimal precision by doing combined mathematical functions.
> >
> > And in regards to "any programmer use any programming language without
> > being intimately familiar with the corresponding documentation".
> >
> > 1.  I do combined mathematical formulas in LOTS of different languages,
> > and RPG is the only one that has this quirk.  After reading up on
> mathematical
> > formulas, how numbers are store, what a mantissa is, how computers perform
> > math, the difference between BCD and floating point, time evaluations on
> > doing a clear .vs. a move et. al.
> >
> > I have read this for enough languages (FORTRAN, COBOL, Pascal, Basic,
> > C, etc..) so that I understand it.
> >
> > Now, behind me is a book case, it is 4 feet high by 3 feet wide.  Inside
> of this
> > bookcase are 42 note books, the majority containing one book, quite a few
> > containing 2 or more books.  Out of these I have read maybe 10 cover to
> cover,
> > such as the CL Reference, DDS reference, Operations Guide, and Command
> > Reference, RPG 400 guides, et al.  Others I have skimmed thought, some I
> > use for reference and only open when the need arises.  Some of them I will
> > most likely never open.
> >
> > IBM has decided that the printed manual is no longer the norm, that now
> books
> > are going to be in electronic format.  And,  much of these are scattered
> all
> > over the place, Softcopy Library, Rebook Softcopy Library, Books on Line,
> > PDF, and who all knows where else, I sure don't.
> >
> > And, though all this mass of material, I am supposed to be able to know to
> > read one particular book that explains in some particular paragraph that
> IBM
> > has decided that the way all other compilers do math is wrong, that IBM
> has
> > the right way, although it will, in effect, produce less accuracy over the
> long
> > run.
> >
> > Now that I know about it, I can work around it.  But a couple of points
> here.
> >
> > 1.  I shouldn't have to work around it.  Nor should others.
> > 2.  What about all the other programmers that don't know about it?
> > 3.  People don't read the manual to do something as simple as multiplying
> A times
> >
> >      B and dividing by C.
> > 4.  This "feature" is going to produce more bugs that programmers won't
> >      be able to find without careful examination of how IBM has decided to
> do
> >      their math routines.  The behavior it is trying to fix (Overflows) is
> so
> >      minute in comparison to lost accuracy.
> > 5.  And who says I don't understand the rules?  Is there any behavior I
> stated
> >      in my posts that wasn't correct?  Would it not in fact loose accuracy
> as I
> >      stated?  If I am in error, let me know where.  If I am not in error,
> don't
> > say
> >      I don't understand it.
> >
> > Regards,
> >
> > Jim Langston
> >
> > boldt@ca.ibm.com wrote:
> >
> > > <SNIP>
> >
> > >
> > > Oh dear oh dear oh dear!
> > >
> > > I hope this doesn't sound rude, but how can any programmer use any
> > > programming language without being intimately familiar with the
> > > corresponding documentation?
> > >
> > > Sure, we could have come up with better rules for decimal precision.
> > > But please don't criticize the existing rules while admitting you
> > > don't even understand them.
> > >
> > > Cheers!  Hans
> > >
> > > Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
> > >
> > > +---
> > > | 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
> > > +---
> >
> > +---
> > | 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
> > +---
>
> +---
> | 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
> +---

+---
| 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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.