It is indeed a big can o' worms. I have not yet given any detailed consideration to representations in binary and hexadecimal. However, I will admit that these issues have been in the back of my mind.
As far as representing imaginary components, I am looking at several possibilities, particularly in light of the fact that I want to handle not only real and complex, but also quaternions (4 components) and octonions (8 components). I have not looked at APL in a long time. I will take a look and see what they are doing. John P. Baker -----Original Message----- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of Tony Harminc Sent: Monday, April 28, 2008 12:23 PM To: IBM-MAIN@BAMA.UA.EDU Subject: Re: Fixed-Point and Scientific Notation This is a big can o' worms. Programming languages vary so much in their syntax and semantics that I doubt you'll be able to come up with anything compatible with all. But if I may make a couple of points: So far all this seems to assume that the number (or components thereof) will be written in decimal. Since two of the three representations under discussion are not decimal based, surely you should allow for hex or binary specification of the number or components. Names like single, double, and quad are sure to be interpreted differently by different people, languages, and hardware architectures. I'd suggest specifying the number of digits of the base in use. PL/I allows the specification of what it calls base (BINARY or DECIMAL), scale (FLOAT or FIXED), precision (significant digits and decimal-point placement), and mode (REAL or COMPLEX). Unfortunately it doesn't, to my knowledge, allow for multiple kinds of FLOAT BINARY representation, or put another way, for FLOAT HEXADECIMAL. In any case, there is no way to specify these attributes in detail for a constant; the above are for variable declarations. (Well, modern PL/I has declared constants, but they are not syntactically different from preinitialized variables.) Another approach to consider for constants is APL's idea of Representation and Base Value. These are well summarized at http://www.sigapl.org/encode.htm . APL adds the intriguing concept of mixed bases, the classic example of which is the pre-decimal UK pounds, shillings, and pence currency. I doubt we'll see that in hardware any time soon, however... Tony H. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html