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

Use types larger than 32bit #57

Open
GMellar opened this issue Sep 9, 2023 · 5 comments
Open

Use types larger than 32bit #57

GMellar opened this issue Sep 9, 2023 · 5 comments
Labels
question Further information is requested

Comments

@GMellar
Copy link

GMellar commented Sep 9, 2023

I was wondering how to use larger base types for example Q32.16 and use all the multiplication and division routines. Is there any plan to support this?

@MikeLankamp MikeLankamp added the question Further information is requested label Sep 11, 2023
@MikeLankamp
Copy link
Owner

Hi @GMellar, at the moment fpm supports any native integer type as base and intermediate type. However, unless your compiler defines a 128-bit integer type (for fpm's intermediate type), it's not possible to define a 64-bit fixed-point type.

There is an open request (#8) to support e.g. boost::multiprecision::cpp_int which would solve this.

Does this answer your question?

@peterson79
Copy link

Does this mean at the moment a Q48.16 is not possible?

@MikeLankamp
Copy link
Owner

For most common platforms, yes, it's not possible at the moment.

@id01
Copy link

id01 commented Nov 4, 2023

If you're using gcc, you can use __int128_t

@SirNate0
Copy link

For me, I had to define

// in namespace std
template <>
struct is_signed<__int128_t>: std::true_type{};

for it to work. But I was able to use a 64bit fixed point type with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants