GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Support hexadecimal floating point literals by MaxGraey · Pull Request #2460 · AssemblyScript/assemblyscript

Conversation

@MaxGraey

@MaxGraey MaxGraey commented Aug 23, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@MaxGraey
finilize
74b4d79
@MaxGraey
MaxGraey requested a review from dcodeIO August 23, 2022 17:15
@MaxGraey MaxGraey added the enhancement label Aug 23, 2022
@MaxGraey
remove non-relevant test case
e926257
@MaxGraey
MaxGraey marked this pull request as draft August 23, 2022 17:43
@MaxGraey
simlify comments
191f8f6
@MaxGraey MaxGraey mentioned this pull request Aug 26, 2022
Minor refactorings for numeric parsing in tokenizer #2472
Merged
2 tasks done
MaxGraey added 2 commits August 26, 2022 23:30
@MaxGraey
Merge branch 'main' into hexfloats
9b422ab
@MaxGraey
clean
3dd9cef
@MaxGraey MaxGraey changed the title feat: Support hexadecimal float pointing literals feat: Support hexadecimal floating point literals Aug 28, 2022
@MaxGraey MaxGraey mentioned this pull request Aug 28, 2022
[Feature] Support stringified via tags numeric literals #2480
Open

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dcodeIO dcodeIO Awaiting requested review from dcodeIO

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@MaxGraey
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.