[go: nahoru, domu]

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

Existing decimal usage in the web platform #80

Open
annevk opened this issue May 22, 2023 · 3 comments
Open

Existing decimal usage in the web platform #80

annevk opened this issue May 22, 2023 · 3 comments

Comments

@annevk
Copy link
Member
annevk commented May 22, 2023

I stumbled across https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/Decimal.cpp today. This is apparently used for <input>, see https://github.com/WebKit/WebKit/blob/main/Source/WebCore/html/InputType.cpp.

I think a goal of this effort needs to be that it can serve as a replacement of this existing Decimal class (or expose the existing class to script).

This relates to #4 but seemed different enough to warrant its own issue.

@jessealama
Copy link
Collaborator

I didn't know about this use of decimal numbers inside WebKit -- thanks for the tip!

@littledan
Copy link
Member

Interesting, looks like Chrome has this as well: https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:third_party/blink/renderer/platform/wtf/decimal.h

Looks like this operates with a 16-bit exponent and 64-bit mantissa. This probably continues the pattern that I noted in a decimal presentation a while ago: Everyone has different decimal details, and users don't run into these edge cases and don't care.

@littledan
Copy link
Member

Oh, I guess Mozilla contains the same code, used in the same way for input elements! https://searchfox.org/mozilla-central/search?q=symbol:T_mozilla%3A%3ADecimal&redirect=false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants