GeezerVison is showing github.com — feat: Support hexadecimal floating point literals by MaxGraey · Pull Request #2460 · AssemblyScript/assemblyscript
Conversation
MaxGraey
commented
Aug 23, 2022
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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.
MaxGraey
changed the title
feat: Support hexadecimal float pointing literals
feat: Support hexadecimal floating point literals
Aug 28, 2022
This branch has not been deployed
No deployments
Reviewers
dcodeIO
Awaiting requested review from dcodeIO
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.