Hallo Martin,
Du schriebst am Fri, 15 Nov 2013 07:33:08 +0100:
> type
> boolty = :8; //bool8
> cardty = :+8; //card8
> intty = :-8; //int8
> charty = :#8; //char8
What's the difference between "#" and "+"? Why do you think it should be
neccessary?
What's the difference between "bool<n>" and "card<n>"? Just to specify any
number of wasted bits?
> floatty = :.64; //flo64
Do you really think this is neccessary? Do you really want to define your
special "float" type different from the established IEEE standard? You
won't be able to use _any_ exisiting floting point processor or library
then, as none of these allow for arbitrary sized floating point numbers.
IEEE defines just two sizes, AFAIK: single precision with 32 bits and
double proecision with 64 bits. Even the 80 bit "extended" type formerly
used by intel is not contained in this standard.
So you might contemplate doing what everyone else does and simply provide
two fixed keywords for these two sizes.
They aren't _integer_ constructs after all, they already _are_ some kind
of "bitpacked records", comprised of three fields, an exponent field,
possibly signed or otherwise biased, a sign field for the value as a whole,
and the mantissa field, specifying the first few digits of the value. You
could declare it somewhat like this (I think, the bit counts might be off
a little):
TYPE
double = bitpacked RECORD
exponent: 9;
negative: 1;
mantissa: 54;
END;
In addition, the mantissa has a size of _55_ bits, as there's usually an
implied "1" as the highest bit. Manipulating this construct is rather
involved and requires multiplestages of disassembling the parts of the
value, checking for compatibility, shifting and calculating, and
reassembling the result.
There _was_ a reason why it took quite some time until FPUs were as
ubiquitous components of a processor as they are today, where a few
thousand gates aren't considered highly complex any more.
--
--
(Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung
nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem)
-----------------------------------------------------------
Mit freundlichen Grüßen, S. Schicktanz
-----------------------------------------------------------
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk