Ticket #11130: 11130_sagelib32.patch

File 11130_sagelib32.patch, 4.1 KB (added by cremona, 8 years ago)

Apply after previous

  • sage/rings/integer.pyx

    # HG changeset patch
    # User John Cremona <john.cremona@gmail.com>
    # Date 1303940454 -3600
    # Node ID 926ff153ea9fe5503941514cd8a2e8366713518b
    # Parent  ab527dc14dbbb2ca2572f816bc8674805984a74f
    11130: fine tuning for 32-bit doctests
    
    diff -r ab527dc14dbb -r 926ff153ea9f sage/rings/integer.pyx
    a b  
    43874387            sage: 3._bnfisnorm(QuadraticField(-1, 'i'))
    43884388            (1, 3)
    43894389            sage: 7._bnfisnorm(CyclotomicField(7))
    4390             (-zeta7 + 1, 1)
     4390            (-zeta7 + 1, 1)            # 64-bit
     4391            (-zeta7^5 + zeta7^4, 1)    # 32-bit
    43914392        """
    43924393        from sage.rings.rational_field import QQ
    43934394        return QQ(self)._bnfisnorm(K, certify=certify, extra_primes=extra_primes)
  • sage/rings/number_field/number_field.py

    diff -r ab527dc14dbb -r 926ff153ea9f sage/rings/number_field/number_field.py
    a b  
    36133613
    36143614            sage: pari('setrand(2)')
    36153615            sage: L.<b> = K.extension(x^2 - 7)
    3616             sage: L.factor(a + 1)
    3617             (Fractional ideal (1/2*a*b + a + 1/2)) * (Fractional ideal (-1/2*b - 1/2*a + 1))
     3616            sage: f = L.factor(a + 1); f
     3617            (Fractional ideal (-1/2*a*b - a - 1/2)) * (Fractional ideal (1/2*b + 1/2*a - 1)) # 32-bit
     3618            (Fractional ideal (1/2*a*b + a + 1/2)) * (Fractional ideal (-1/2*b - 1/2*a + 1)) # 64-bit
     3619            sage: f.value() == a+1
     3620            True
    36183621           
    36193622        It doesn't make sense to factor the ideal (0), so this raises an error::
    36203623       
  • sage/rings/number_field/number_field_element.pyx

    diff -r ab527dc14dbb -r 926ff153ea9f sage/rings/number_field/number_field_element.pyx
    a b  
    11391139
    11401140            sage: K.<a, b> = NumberField([x^2 - 2, x^2 - 3])
    11411141            sage: L.<c> = K.extension(x^3 + 2)
    1142             sage: t = (2*a + b)._rnfisnorm(L); t[1]
    1143             (b - 2)*a + 2*b - 3
    1144             sage: t[0].norm(K)*t[1]
    1145             2*a + b
     1142            sage: s = 2*a + b
     1143            sage: t = s._rnfisnorm(L)
     1144            sage: t[1] == 1 # True iff s is a norm
     1145            False
     1146            sage: s == t[0].norm(K)*t[1]
     1147            True
    11461148
    11471149        AUTHORS:
    11481150
  • sage/rings/polynomial/polynomial_quotient_ring.py

    diff -r ab527dc14dbb -r 926ff153ea9f sage/rings/polynomial/polynomial_quotient_ring.py
    a b  
    735735            sage: R.<x> = K[]
    736736            sage: S.<xbar> = R.quotient(x^2 + 23)
    737737            sage: S.S_class_group([])
    738             [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, 1/2*xbar - 3/2)]
     738            [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, -1/2*xbar + 3/2)] # 32-bit
     739            [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, 1/2*xbar - 3/2)] # 64-bit
    739740            sage: S.S_class_group([K.ideal(3, a-1)])
    740741            []
    741742            sage: S.S_class_group([K.ideal(2, a+1)])
    742743            []
    743744            sage: S.S_class_group([K.ideal(a)])
    744             [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, -1/2*xbar + 3/2)]
     745            [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, 1/2*xbar - 3/2)] # 32-bit
     746            [((2, -a + 1, 1/2*xbar + 1/2, -1/2*a*xbar + 1/2*a + 1), 6, -1/2*xbar + 3/2)] # 64-bit
    745747
    746748        Now we take an example over a nontrivial base with two factors, each
    747749        contributing to the class group::
     
    11341136            sage: D.selmer_group([K.ideal(2, -a+1), K.ideal(3, a+1)], 3)
    11351137            [2, -a - 1]
    11361138            sage: D.selmer_group([K.ideal(2, -a+1), K.ideal(3, a+1), K.ideal(a)], 3)
    1137             [2, -a - 1, -a]  # 32-bit
    1138             [2, -a - 1, a]   # 64-bit
     1139            [2, -a - 1, a]
    11391140
    11401141        """
    11411142        units, clgp_gens = self._S_class_group_and_units(tuple(S), proof=proof)