On Thu, 3 Jul 2003, Emil Jerabek wrote:
On Wed, Jul 02, 2003 at 10:14:22PM +0200, Frank Heckenbach wrote:
Mirsad Todorovac wrote:
Anyway, I propose we put thing of this sort on a WISH-LIST, w priorities, so we'd don't forget about it and propose it again.
Many items on the to-do list are "wishes", and the mentioned `SELECTED_REAL_KIND' is already there. (Though it may refer to a feature to choose between the available standard real types according to some parameters -- as I said, I don't know it exactly.)
I don't know much about Fortran either, but I'm afraid that "KIND" has the meaning you put in parenthesis, not a handcrafted user-defined type. See `info g77', for example.
Err, well, it's not a "handcrafted user-defined" type, it's actually meant to be IEEE-form floating point number, it's just that exponent and mantissa size is customizable.
I.e. like Integer attribute (Size = 42), likewise you'd have Real (ExponentSize = 22, MantissaSize = 42), depending on the fact you need more in maximum range, or more in maximum precision to be stored in variable ...
When possible, arithmetic would be done in hardware precision, if that is greater or equal than type's own precision, otherwise it would be done by emulation. This is inefficient to select at runtime, or have both types of code; hence the idea that compiler is armed itself with it -- just like it can do Integer attribute (Size = 1..64).
We might chose to limit ExponentSize and MantissaSize attributes for Real just like Size attribute is limited for Integer, Word and Cardinal to maximum that harware can accomplish.
In Pascal unit (probably schemata) implementation, we just might not have to limit anything OTOH. But the price is lost efficiency. (Just like with sets: to test one bit (a IN setA), we have to construct entire function call.)
Emil?
Mirsad