big integer implementation

So does the big integer class use the CPU's carry flag? I'm picturing an implementation where you chop the dataset into int32_t. Then, for the add operation, each piece is composed of a.int32_t[x]+b.int32_t[x]+carry flag of the previous operation. Does that sound right? If so, I'm wondering how you're using the carry flag. Do you get that using assembly code or is there some standard C/C++ command to give you access to that? (Or would somebody mind taking a second and pointing me to the correct location for the code for that?) Using the above method, I think it would be quite useful to have these dataset types: u/int128_t, u/int192_t, u/int256_t Anyone else agree? ______________________________ Brannon King ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

It would be nice if there was an api abstraction over the carry flag. Even better if there was an abstraction over extended add, subtract, divide and multiply on int and uint arrays. I would however prefer [u]int<size_t> template that uses the above methods rather than a specific u/int128_t, u/int192_t, u/int256_t. These were some of my existing comments on other big integer libraries of a need of larger fixed sized integer that could be used on the stack. There still has been no answer. -----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Brannon King Sent: Wednesday, July 12, 2006 12:03 PM To: boost@lists.boost.org Subject: [boost] big integer implementation So does the big integer class use the CPU's carry flag? I'm picturing an implementation where you chop the dataset into int32_t. Then, for the add operation, each piece is composed of a.int32_t[x]+b.int32_t[x]+carry flag of the previous operation. Does that sound right? If so, I'm wondering how you're using the carry flag. Do you get that using assembly code or is there some standard C/C++ command to give you access to that? (Or would somebody mind taking a second and pointing me to the correct location for the code for that?) Using the above method, I think it would be quite useful to have these dataset types: u/int128_t, u/int192_t, u/int256_t Anyone else agree? ______________________________ Brannon King ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Brannon King
-
Jarrad Waterloo