Editorial: Fix ecmarkup warnings#645
Conversation
gibson042
commented
Jan 13, 2022
| 1. Let _exponent_ be ComputeExponent(_numberFormat_, _x_). | ||
| 1. Let _x_ be _x_ × 10<sup>-_exponent_</sup>. | ||
| 1. Set _x_ to _x_ × 10<sup>-_exponent_</sup>. | ||
| 1. Let _formatNumberResult_ be FormatNumericToString(_numberFormat_, _x_). |
There was a problem hiding this comment.
@sffc There is an unrelated problem here: FormatNumericToString expects a Number or BigInt value, while x is a mathematical value that AFAICT might suffer output-affecting lossiness if converted.
And similar problems in later steps (in which whether or not x is a mathematical value is dependent upon whether or not the original input was finite!):
- GetNumberFormatPattern performs incoherent comparisons on its input,
_x_ is 0 or _x_ > 0is only valid for mathematical_x_while_x_ is *NaN*can only be true if_x_is a Number. - Likewise, PartitionNotationSubPattern seems to expect a mathematical x but then compares it to infinities and
*NaN*.
I think the best fix would be updating FormatNumericToString/GetNumberFormatPattern/PartitionNotationSubPattern/etc. to accept new parameters allowing them to identify special non-mathematical Number values such as negative zero and infinities and NaN.
sffc
left a comment
There was a problem hiding this comment.
LGTM and after this is merged I'll need to merge these changes into NFv3