Re: Motion P1788/M0036.03: NO Flavors (a comment, not a vote)
John Pryce wrote:
> In fact the comparison seems to me to be very close. Binary and
> decimal are the two "flavors" of 754 arithmetic!
One difference is that 1788 flavors propose a "constant attibute",
whereas the 754-2008 radix is more like a type attribute carried
by each datum. (There is a radix(datum) required function; we did
not propose a flavor(interval) function -- only a currentFlavor()
environmental function.)
Languages have indeed implemented the BFP vs DFP distinction via
different types, though I suspect a language that makes the DFP/BFP
distinction flavor-like is possible; indeed, pre-DFP C could be
described this way (the radix of K&S C "float" or "double" could be
anything).
The 754-2008 decimal encoding flavors (BID/DPD) provide a closer analogy.
Even closer is the distinction between BFP and HFP, or Ebcdic vs Ascii,
encountered in situations where both alternatives can coexist on one
platform, e.g. IBM's Z-series. On IBM's P-series there are two different
flavors of "long double", as I believe there are on Intel/HP Itanium. In
each case the distinction is based on compiler options or pragmas, and
there are macros to enquire about the current flavor.
Michel.
---Sent: 2012-08-30 15:07:35 UTC