[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with 64-bit numbers
> Date: Wed, 8 May 96 08:15:10 EDT
> From: Mike Griebling <grieblm@trt.allied.com>
>
> Any ideas on what happens with the SET data type once
> the compiler is ported to a 64-bit computer?
>
> I would tend to make the SET type 64 bits but some would
> say that this will "automatically double all our memory
> requirements" and there is also the issue of binary
> compatibility with existing applications which store SET
> types to files.
Yes, I'd probably say something like that. How did you know? :-)
> As a recommendation, and in the spirit of the HUGEINT
> extension of the 32-bit integers, I would propose a
> similar HUGESET which would allow representation of
> 64-bit sets. (As an aside, some operating systems
> support sets which are smaller than 32-bits so it
> may also be useful to consider adding support for
> smaller sets in the SYSTEM module).
You probably want the whole circus of set operations defined on the
new types, too? Like union, intersection, difference, symmetrical
difference, complement, test for membership, test if equal, test if
not equal, include, exclude, MIN, and MAX?
I don't think it'd be appropriate to introduce implicit type
conversions between the different set types, like the ones that exist
for integer types. This means that values of different set types
cannot be compared and aren't assignment compatible.
> I can see the following additional set types defined
> in the SYSTEM:
>
> SHORTSET -- 8-bit set
> WORDSET -- 16-bit set
The definition of a `word' is very vague and differs between different
architectures and manufacturers. I'd prefer a more rational naming
scheme: SET8, SET16, and for completeness SET32 and SET64. The latter
two would be aliases to SET and HUGESET, respectively. All these
names are declared in SYSTEM.
> I'm not so sure whether the HUGESET should also be
> declared in the SYSTEM module or built into the language.
If HUGEINT is a standard type, then HUGESET should be one, too. I
can't think of any reason why one of them should be declared standard,
while the other is marked as system dependent.
-- mva