Skip to content

Proposal: Add fixed-point arithmetic types #7093

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

Closed
kliberty opened this issue Nov 12, 2020 · 1 comment
Closed

Proposal: Add fixed-point arithmetic types #7093

kliberty opened this issue Nov 12, 2020 · 1 comment
Milestone

Comments

@kliberty
Copy link

Fixed point arithmetic seems to be used often in embedded systems and business logic. IMO this would be an attractive addition to the language.

If we only wanted to support binary numbers I would propose using the syntax Qm.f (where m is the number of magnitude bits and f is the number of fractional bits). Alternatively, types could be based on a builder to support complex features @FixedPoint(magnitude, fractional, saturate = false, decimal = false) .

@Vexu
Copy link
Member

Vexu commented Nov 12, 2020

Duplicate of #1974

@Vexu Vexu marked this as a duplicate of #1974 Nov 12, 2020
@Vexu Vexu closed this as completed Nov 12, 2020
@andrewrk andrewrk added this to the 0.8.0 milestone Jan 3, 2021
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