Vincent,
Thank you for your answer. No I understand your suggestions better.
5) Do your (B1)-(B5) definitions define "number format" format as a
finite subset set of floating-point data (Level 2 of IEEE754-2008 ) ?
No, it must also be a 754 format (Level 2) as specified by Motion 6.04,
well, except that here, one may want to distinguish +0 and -0. But this
should be done by later motions. I suspect that in input, there will be
no differences between +0 and -0 for P1788. But IMHO, if a sup(X) or
mag(X) is 0 at Level 1, then it must have the + sign. And for a format F
as mentioned in B4, the rounding rules must be the ones of IEEE 754,
where the sign of 0 is specified.
B1-B3 mainly specify bindings to IEEE 754-2008.
I think that the motion should say this in more clear way.
I misunderstood this section initially. I think that some othere reader can misunderstand too.
Why not say:
<<<
The notion of a 754-conforming implementation has been introduced
in Motion 6.04. A 754 format is one of the number formats defined in IEEE 754-2008
with the following binding to (A1)-(A5):
-Dima
----- Исходное сообщение -----
От: vincent@xxxxxxxxxx
Кому: stds-1788@xxxxxxxxxxxxxxxxx
Отправленные: Вторник, 17 Апрель 2012 г 16:05:01 GMT +04:00 Абу-Даби, Маскат
Тема: Re: Correction --- Motion P1788/M0033.01:NumberFormat -- discussion period begins
On 2012-04-17 01:12:19 -0700, Dmitry Nadezhin wrote:
Vincent,
I want to be sure that I understand your definitions correctly.
So I ask a lot of small questions.
1) The draft of Level2
http://grouper.ieee.org/groups/1788/email/msg04488.html
had the definition of number format:
<<<<<
6.2. Number formats. Having regard to §6.1, a number format, or just
format, is the set of all pairs (x, f ) where x belongs to a finite
subset F of the extended reals R∗ that contains −oo and oo, and f is
a name for F. Normally the format is identified with the set F. A
floating-point format in the 754 sense, such as binary64, is
identified with the number format where F comprises the set of
extended-real numbers that are exactly representable in that format,
where –0 and +0 both represent the mathematical number 0.
Do you want to replace that definition of "number format" by your
definittion of "number format" ?
Yes, in particular my motion adds NaN. Note that if ever it is decided
that operations, like midpoint(Empty), never return NaN, NaN could be
made optional (not completely removed due to IEEE 754 support, as it
can appear in input).
2) Do your (A1)-(A5) definitions define "number format" F as a finite
set of extended real or F is a set of pairs (x, f) with x - extended
real (as in draft level 2) ?
I don't think a difference between both views will appear in the
standard. Even the current definition is a bit ambiguous and needs
to be documented at the language level. For instance, in ISO C, if
you write
typedef t2 t1;
then t1 and t2 designate the same type.
3) Is the set F = { 0, -oo, +oo, NaN } (with some rounding) the
minimal valid "number format" at level (A1)-(A5) ?
Yes.
4) Is the set F = { 0, -1/3, +1/3, -oo, +oo, NaN } a valid
"number format" at level (A1)-A5) ?
Yes.
5) Do your (B1)-(B5) definitions define "number format" format as a
finite subset set of floating-point data (Level 2 of IEEE754-2008 ) ?
No, it must also be a 754 format (Level 2) as specified by Motion 6.04,
well, except that here, one may want to distinguish +0 and -0. But this
should be done by later motions. I suspect that in input, there will be
no differences between +0 and -0 for P1788. But IMHO, if a sup(X) or
mag(X) is 0 at Level 1, then it must have the + sign. And for a format F
as mentioned in B4, the rounding rules must be the ones of IEEE 754,
where the sign of 0 is specified.
B1-B3 mainly specify bindings to IEEE 754-2008.
Note: it goes only to B4.
6) Is the set { -0, +0, -oo, +oo, NaN } (with some rounding) the
minimal valid "number format" at level (B1)-(B5) ?
No, see above.
7) I guess that the set { -0, +0, -1/3, +1/3, -oo, +oo, NaN } is not
valid "the number format" at level (B1)-(B5).
Is it ?
No, it isn't.
8) Is IEEE754 Binary64 with excluded subnormals a valid "number format"
at level (B1)-(B5) ?
Since subnormals cannot be expluded from IEEE 754-2008, no.
9) Let is take two subsets of IEEE754-2008 floating-point data that
correspond to Level2 Binary64 and Level2 Decimal64 .
Is their union is a valid number format at level (B1)-(B5) ?
It is not a valid format of IEEE 754-2008, so no.
10) You answered in another mail that Java types "int", "long", "BigInteger", "BigDecimal"
are not valid "P1788 number formats" because they don't contain special vales.
Nevertheless, the rationale says that
the constraints ...
allows conventional formats, such as floating-point numbers (with
or without subnormals), fixed-point numbers (including integers),
rational numbers (with bounded numerator and denominator),
What does it mean (especially "including integers") ?
Perhaps I should have said "arithmetic". One can still augment them
by adding the required special values. How this is done will depend
on the language, and there is room for optimization (e.g. if one can
prove that these special values will never occur).
For instance, "long" alone cannot be used if at Level 1, sup(X) can
be greater than the maximum value of "long". But the implementation
can add specific functions, that fall out of the scope of the
standard.
More importantly, the language already has at least a native valid
format for this motion.