[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Resend: Clarify decimal encoding of NaN's



754r Committee:

I sent this out yesterday, but the formatting was garbled.  Apologies
if you get this message twice.

Thanks,

Charles Tsen

======================================================================



Motion:

=======

Clarify decimal NaN encoding of payloads in Section 5.5. The new text
makes some assumptions, where the old text left holes.



Rationale:

==========

The draft's description of the payload for NaN's seems a bit abstruse
to me. Particularly, it seems to leave a few questions regarding
canonical/non-canonical NaN's. I've rewritten it below, but am open to
any guidance or edits.

Issue1:

-------

The draft states (on page21, section 5.5, bullet a, paragraph 2) "A
canonical NaN representation has bits G6 through Gw+4 zero, and the
trailing significand T is canonical ..."

Why doesn't the draft mention anything about non-canonical NaN's? This
would lead me to assume that any of the following (1) there is no such
thing as a non-canonical NaN or (2) that non-canonical NaN's may
exist, but are illegal or (3) non-canonical NaN's are interpreted as 0
or (4) non-canonical NaN's are interpreted as NaN's with a payload of
0.

Whatever the case, it should be stated.

Issue2:

-------

The draft states (on page21, section 5.5, bullet a, paragraph 1) "The
remaining bits of G together with T (encoded as for finite numbers
below) distinguish various NaN's."

If it's true that NaN's are encoded as finite numbers, it must have a
100(binary) prepended to the significand, since its steering bits {G0,
G1} == 11(binary), which seems unnecessarily confusing.



Text:

=====

Replace:

--------

"If G0 through G4 are 11111, then r is qNaN or sNaN and v is NaN
regardless of S. The remaining bits of G together with T (encoded as
for finite numbers below) distinguish various NaNs. If G5 is 1, then r
is sNaN; otherwise r is qNaN.

A canonical NaN representation has bits G6 through Gw+4 zero, and the
trailing significand T is canonical, with the maximum value for the
payload of a canonical NaN therefore being 10(3×J) − 1."

With:

-----

"If G0 through G4 are 11111, then v is NaN regardless of S.
Furthermore, if G5 is 1, then r is sNaN; otherwise r is qNaN. The
remaining bits of G together with T constitute the NaN's payload,
which helps distinguish it from other NaN's.

The NaN payload has an exponent and a significand field identical to
finite numbers below. These fields are encoded similarly, except
assuming G0 and G1 together are NOT 11."

A NaN can be either canonical or non-canonical. It is canonical if
bits G6 through Gw+4 are zero and T is canonical. If it is
non-canonical <insert correct assumption here, from issue1 in
rationale>"− 1."

With:

-----

"If G0 through G4 are 11111, then v is NaN regardless of S.
Furthermore, if G5 is 1, then r is sNaN; otherwise r is qNaN. The
remaining bits of G together with T constitute the NaN's payload,
which helps distinguish it from other NaN's.

The NaN payload has an exponent and a significand field identical to
finite numbers below. These fields are encoded similarly, except
assuming G0 and G1 together are NOT 11."

A NaN can be either canonical or non-canonical. It is canonical if
bits G6 through Gw+4 are zero and T is canonical. If it is
non-canonical <insert correct assumption here, from issue1 in
rationale>"

754 | revision | FAQ | references | list archive