Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Support hexadecimal floating point literals#2460

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
MaxGraey wants to merge5 commits intoAssemblyScript:main
base:main
Choose a base branch
Loading
fromMaxGraey:hexfloats

Conversation

MaxGraey
Copy link
Member

@MaxGraeyMaxGraey commentedAug 23, 2022
edited
Loading

Examples

0x1.999999999999ap-4-0X0.1P4-0x1A.p+100

Motvation

  • Hexadecimal float pointing literals can represent float points exactly without complicated and expensive parsing. It's quite useful for math calculations;
  • Hexadecimal float pointing format supported in many languages (C, C++, Julia and etc). Therefore, support for this format makes it easier migration;
  • Hexadecimal float pointing format supported by WebAssembly spec. And since we support the same things as WebAssembly, it makes sense to add support to the language itself.

As always, the TS language doesn't support such literal format, so as usual we can use the standard way (@ts-ignore) to mute ts checker.

Firstly, we need to add built-in literal templates like:

f64`0x1.999999999999ap-4`i32`123`
  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@MaxGraeyMaxGraey marked this pull request as draftAugust 23, 2022 17:43
@MaxGraeyMaxGraey changed the titlefeat: Support hexadecimal float pointing literalsfeat: Support hexadecimal floating point literalsAug 28, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dcodeIOdcodeIOAwaiting requested review from dcodeIO

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@MaxGraey

[8]ページ先頭

©2009-2025 Movatter.jp