Question about Boost Integer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about Boost Integer

Boost - Users mailing list
Hi everyone, i'm pretty new to Boost. I need to use as a default type for the CNL. The problem is that i would need an integer type that can assume only 2^4 values (so basically that stays on 4 bits). What i am asking is that if there is a way to define an integer like int128_t but instead of 128 i would need to have 4. Thank you very much for your answers.
Emilio

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Question about Boost Integer

Boost - Users mailing list
See this page, int128_t is simply

// Fixed precision signed types:
typedef number<cpp_int_backend<128, 128, signed_magnitude, unchecked, void> >     int128_t;


Change 128 to what you want.


On Sat, Feb 27, 2021 at 4:44 AM Emilio Paolini via Boost-users <[hidden email]> wrote:
Hi everyone, i'm pretty new to Boost. I need to use as a default type for the CNL. The problem is that i would need an integer type that can assume only 2^4 values (so basically that stays on 4 bits). What i am asking is that if there is a way to define an integer like int128_t but instead of 128 i would need to have 4. Thank you very much for your answers.
Emilio
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Question about Boost Integer

Boost - Users mailing list
In reply to this post by Boost - Users mailing list

On Sat, Feb 27, 2021 at 4:44 AM Emilio Paolini via Boost-users <[hidden email]> wrote:
Hi everyone, i'm pretty new to Boost. I need to use as a default type for the CNL. The problem is that i would need an integer type that can assume only 2^4 values (so basically that stays on 4 bits). What i am asking is that if there is a way to define an integer like int128_t but instead of 128 i would need to have 4. Thank you very much for your answers.
Emilio
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users