Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate NaN in spec #39

Closed
sffc opened this issue Jun 12, 2021 · 0 comments
Closed

Investigate NaN in spec #39

sffc opened this issue Jun 12, 2021 · 0 comments
Labels
editorial Issue should be resolved in the spec

Comments

@sffc
Copy link
Collaborator

sffc commented Jun 12, 2021

From @FrankYFTang:


Also in the README.md it said

Ranges to infinity are supported, but if either value is NaN, an error is thrown. (#12)

nf.formatRange(500, 0/0); // RangeError

But I have a hard time figuring out where in the spec to throw the NaN now.
I don't think ToIntlMathematicalValue will throw if the value is NaN right?
https://tc39.es/proposal-intl-numberformat-v3/out/numberformat/diff.html#sec-partitionnumberrangepattern

If x is a non-finite Number or y is is a non-finite Number, throw a RangeError exception.

What is the definition of "non-finite Number" ?
Is NaN a "non-finite Number" ? I cannot tell
https://tc39.es/proposal-intl-numberformat-v3/out/numberformat/diff.html#sec-partitionnumberpattern
surely won't throw if NaN because

If x is NaN, then
Let n be an implementation- and locale-dependent (ILD) String value indicating the NaN value.

@sffc sffc added the editorial Issue should be resolved in the spec label Jun 12, 2021
@sffc sffc closed this as completed in b10389e Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial Issue should be resolved in the spec
Projects
None yet
Development

No branches or pull requests

1 participant