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

Support fraction-only unsigned numbers #51

Open
Elgot opened this issue Apr 9, 2023 · 0 comments
Open

Support fraction-only unsigned numbers #51

Elgot opened this issue Apr 9, 2023 · 0 comments

Comments

@Elgot
Copy link

Elgot commented Apr 9, 2023

I would like to use all bits to represent fractions. For signed types this seems to work: a fpm::fixed<int8_t, int16_t, 7> gives a range of [-1, 0.992188].

This doesn't work for unsigned types however. fpm::fixed<uint8_t, uint16_t, 7> gives a range of [0, 1.99219]. A fpm::fixed<uint8_t, uint16_t, 8> would give the expected result, but this type is blocked by a static_assert.

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

1 participant