Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have a 64 bit algorithm that uses modular multiplicative inverse and coprime numbers, and I need to convert it to 32 bit. This math is not my area, and I cannot find an online calculator, so I hope someone here can help me.

In 64 bit, I have:

multiplier_C = 6364136223846793005;
multiplier_inv_C = -4568919932995229531;
offset_C = 1442695040888963407;

These are from Knuth's linear congruential generator. I need the following:

multiplier_C must be 30 bits in size, and multiplier_inv_C must be its modular multiplicative inverse.

offset_C must be 29 or 30 bits in size, and a coprime of $2^{32}$.

share|improve this question
1  
Take a look at Rick Regan's blog: exploringbinary.com –  Rod Carvalho Sep 12 '12 at 1:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.