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

Radix operations are not defined #318

Open
GPHemsley opened this issue Jun 3, 2017 · 2 comments
Open

Radix operations are not defined #318

GPHemsley opened this issue Jun 3, 2017 · 2 comments
Labels
clarification Standard could be clearer

Comments

@GPHemsley
Copy link
Member

The "IPv4 number parser" and the "port state" of the "basic URL parser" mention radix-R (or radix-10) operations. (I presume "radix" is used to avoid confusion with the other definition of "base" used in the same document.)

However, it does not provide instructions on how to perform radix-based operations.

If input contains a code point that is not a radix-R digit, then return failure.

Return the mathematical integer value that is represented by input in radix-R notation, using ASCII hex digits for digits with values 0 through 15.

Let port be the mathematical integer value that is represented by buffer in radix-10 using ASCII digits for digits with values 0 through 9.

It would be good for there to be explicit instructions on how to perform these radix operations (particularly that first one, where R can be 10, 16, or 8, in context), either here or in Infra. Otherwise, it is up to the implementation to determine how to map 10 => 0-9, 16 => 0-F, and 8 => 0-7, a seemingly non-trivial task.

@annevk
Copy link
Member

annevk commented Jun 29, 2017

This is inspired by https://tc39.github.io/ecma262/. If this needs fixing here it probably needs fixing there too.

@GPHemsley
Copy link
Member Author

GPHemsley commented Jun 29, 2017

In particular, parseInt and Number.prototype.toString.


But you're right, it's not specified there either.

@annevk annevk added clarification Standard could be clearer and removed non-normative labels Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer
Development

No branches or pull requests

3 participants