× 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: bug in MI-compiler
  • From: "Leif Svalgaard" <leif@xxxxxxxx>
  • Date: Thu, 25 Jan 2001 20:10:02 -0600


----- Original Message -----
From: Richard Jackson <richardjackson@richardjackson.net>
To: <MI400@midrange.com>
Sent: Thursday, January 25, 2001 7:02 PM
Subject: RE: bug in MI-compiler


> Well everyone knows that you can't round an integer divide.  Why would ever
> want to do that?
>
> :)

setting aside the "why", the translator shouldn't dump.
setting aside your smiley, the following program produces
the correctly rounded integer result '1':

DCL DD AVG-CHANGE BIN(4) UNSGND;
DCL DD NEW-COUNT  BIN(4) UNSGND INIT(3);;
DCL DD CHANGE  PKD(21,0) INIT(P'2');

DIV(R) AVG-CHANGE, CHANGE, NEW-COUNT;

-----

a packed integer is still an integer.
This little piece of code gave me grief.
Just venting some of that.




+---
| This is the MI Programmers Mailing List!
| To submit a new message, send your mail to MI400@midrange.com.
| To subscribe to this list send email to MI400-SUB@midrange.com.
| To unsubscribe from this list send email to MI400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: dr2@cssas400.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.