summaryrefslogtreecommitdiff
path: root/mpz/kronsz.c
diff options
context:
space:
mode:
authorTorbjorn Granlund <tege@gmplib.org>2010-11-22 22:26:05 +0100
committerTorbjorn Granlund <tege@gmplib.org>2010-11-22 22:26:05 +0100
commit198a1add0f2d556eb75bf2d85c7fceb9fafe9f51 (patch)
treec4fa3b97e983d3f057c0ba032faf39fe303d8f3b /mpz/kronsz.c
parentd7afa9ea9c7dae166cb6719c3b11db9c96cca519 (diff)
downloadgmp-198a1add0f2d556eb75bf2d85c7fceb9fafe9f51.tar.gz
Whitespace cleanup.
Diffstat (limited to 'mpz/kronsz.c')
-rw-r--r--mpz/kronsz.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/mpz/kronsz.c b/mpz/kronsz.c
index 50bf7f667..fd9c09095 100644
--- a/mpz/kronsz.c
+++ b/mpz/kronsz.c
@@ -64,54 +64,54 @@ mpz_si_kronecker (long a, mpz_srcptr b)
a_limb = (unsigned long) ABS(a);
if ((a_limb & 1) == 0)
- {
- /* (0/b)=1 for b=+/-1, 0 otherwise */
- if (a_limb == 0)
- return (b_abs_size == 1 && b_low == 1);
-
- /* a even, b odd */
- count_trailing_zeros (twos, a_limb);
- a_limb >>= twos;
- /* (a*2^n/b) = (a/b) * twos(n,a) */
- result_bit1 ^= JACOBI_TWOS_U_BIT1 (twos, b_low);
- }
+ {
+ /* (0/b)=1 for b=+/-1, 0 otherwise */
+ if (a_limb == 0)
+ return (b_abs_size == 1 && b_low == 1);
+
+ /* a even, b odd */
+ count_trailing_zeros (twos, a_limb);
+ a_limb >>= twos;
+ /* (a*2^n/b) = (a/b) * twos(n,a) */
+ result_bit1 ^= JACOBI_TWOS_U_BIT1 (twos, b_low);
+ }
}
else
{
/* (even/even)=0, and (0/b)=0 for b!=+/-1 */
if ((a & 1) == 0)
- return 0;
+ return 0;
/* a odd, b even
- Establish shifted b_low with valid bit1 for ASGN and RECIP below.
- Zero limbs stripped are accounted for, but zero bits on b_low are
- not because they remain in {b_ptr,b_abs_size} for the
- JACOBI_MOD_OR_MODEXACT_1_ODD. */
+ Establish shifted b_low with valid bit1 for ASGN and RECIP below.
+ Zero limbs stripped are accounted for, but zero bits on b_low are
+ not because they remain in {b_ptr,b_abs_size} for the
+ JACOBI_MOD_OR_MODEXACT_1_ODD. */
JACOBI_STRIP_LOW_ZEROS (result_bit1, a, b_ptr, b_abs_size, b_low);
if ((b_low & 1) == 0)
- {
- if (UNLIKELY (b_low == GMP_NUMB_HIGHBIT))
- {
- /* need b_ptr[1] to get bit1 in b_low */
- if (b_abs_size == 1)
- {
- /* (a/0x80000000) = (a/2)^(BPML-1) */
- if ((GMP_NUMB_BITS % 2) == 0)
- result_bit1 ^= JACOBI_TWO_U_BIT1 (a);
- return JACOBI_BIT1_TO_PN (result_bit1);
- }
-
- /* b_abs_size > 1 */
- b_low = b_ptr[1] << 1;
- }
- else
- {
- count_trailing_zeros (twos, b_low);
- b_low >>= twos;
- }
- }
+ {
+ if (UNLIKELY (b_low == GMP_NUMB_HIGHBIT))
+ {
+ /* need b_ptr[1] to get bit1 in b_low */
+ if (b_abs_size == 1)
+ {
+ /* (a/0x80000000) = (a/2)^(BPML-1) */
+ if ((GMP_NUMB_BITS % 2) == 0)
+ result_bit1 ^= JACOBI_TWO_U_BIT1 (a);
+ return JACOBI_BIT1_TO_PN (result_bit1);
+ }
+
+ /* b_abs_size > 1 */
+ b_low = b_ptr[1] << 1;
+ }
+ else
+ {
+ count_trailing_zeros (twos, b_low);
+ b_low >>= twos;
+ }
+ }
result_bit1 ^= JACOBI_ASGN_SU_BIT1 (a, b_low);
a_limb = (unsigned long) ABS(a);