1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
diff --git a/src/sage/functions/transcendental.py b/src/sage/functions/transcendental.py
index 0bccd9c..2cc0904 100644
--- a/src/sage/functions/transcendental.py
+++ b/src/sage/functions/transcendental.py
@@ -86,13 +86,13 @@ class Function_zeta(GinacFunction):
sage: s = SR('s')
sage: zeta(s).series(s==1, 2)
- 1*(s - 1)^(-1) + (euler_gamma) + (-1/2*stieltjes(1))*(s - 1) + Order((s - 1)^2)
+ 1*(s - 1)^(-1) + (euler_gamma) + (-stieltjes(1))*(s - 1) + Order((s - 1)^2)
Generally, the Stieltjes constants occur in the Laurent
expansion of `\zeta`-type singularities::
sage: zeta(2*s/(s+1)).series(s==1, 2)
- 2*(s - 1)^(-1) + (euler_gamma + 1) + (-1/4*stieltjes(1))*(s - 1) + Order((s - 1)^2)
+ 2*(s - 1)^(-1) + (euler_gamma + 1) + (-1/2*stieltjes(1))*(s - 1) + Order((s - 1)^2)
TESTS::
diff --git a/src/sage/libs/pynac/constant.pyx b/src/sage/libs/pynac/constant.pyx
index 2821d6f..8f6d141 100644
--- a/src/sage/libs/pynac/constant.pyx
+++ b/src/sage/libs/pynac/constant.pyx
@@ -61,6 +61,8 @@ cdef class PynacConstant:
self.pointer = <GConstant *>&g_Catalan
elif self._name == "euler_gamma":
self.pointer = <GConstant *>&g_Euler
+ elif self._name == "NaN":
+ self.pointer = <GConstant *>&g_NaN
else:
GConstant_construct(&self.object, name, texname, domain)
self.pointer = &self.object
diff --git a/src/sage/libs/pynac/pynac.pxd b/src/sage/libs/pynac/pynac.pxd
index 9b3ecfb..bcdff8f 100644
--- a/src/sage/libs/pynac/pynac.pxd
+++ b/src/sage/libs/pynac/pynac.pxd
@@ -216,6 +216,7 @@ cdef extern from "sage/libs/pynac/wrap.h":
GEx g_Pi "Pi"
GEx g_Catalan "Catalan"
GEx g_Euler "Euler"
+ GEx g_NaN "NaN"
GConstant* GConstant_construct(void *mem, char* name, char* texname, unsigned domain)
bint is_a_constant "is_a<constant>" (GEx e)
@@ -293,13 +294,13 @@ cdef extern from "sage/libs/pynac/wrap.h":
void g_list_symbols "list_symbols" (GEx e, GExSet s)
# more is_a tests
- bint is_a_add "is_a<add>" (GEx e)
- bint is_a_mul "is_a<mul>" (GEx e)
- bint is_a_power "is_a<power>" (GEx e)
- bint is_a_fderivative "is_a<fderivative>" (GEx e)
- bint is_a_function "is_a<function>" (GEx e)
- bint is_exactly_a_function "is_exactly_a<function>" (GEx e)
- bint is_a_ncmul "is_a<ncmul>" (GEx e)
+ bint is_a_add "is_a<GiNaC::add>" (GEx e)
+ bint is_a_mul "is_a<GiNaC::mul>" (GEx e)
+ bint is_a_power "is_a<GiNaC::power>" (GEx e)
+ bint is_a_fderivative "is_a<GiNaC::fderivative>" (GEx e)
+ bint is_a_function "is_a<GiNaC::function>" (GEx e)
+ bint is_exactly_a_function "is_exactly_a<GiNaC::function>" (GEx e)
+ bint is_a_ncmul "is_a<GiNaC::ncmul>" (GEx e)
# Arithmetic
int ginac_error()
diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
index 4b70161..445f0fd 100644
--- a/src/sage/symbolic/expression.pyx
+++ b/src/sage/symbolic/expression.pyx
@@ -6605,7 +6605,7 @@ cdef class Expression(CommutativeRingElement):
60*z^4*w^2*x^2*u^5 + 375*z^8*w^3*x*y*u^7 + 150*z^8*w^5*x*y^4*u^6 + \
180*z^6*x*y^3*u^5 + 216*z^6*w^3*x^2*y^3*u^6;
sage: d = e.diff(x)
- sage: gcd(d,e) / (u^4*z^2) in QQ # known bug
+ sage: gcd(d,e) / (u^4*z^2) in QQ
True
"""
cdef Expression r = self.coerce_in(b)
@@ -6652,9 +6652,9 @@ cdef class Expression(CommutativeRingElement):
True
sage: lcm(x^100-y^100, x^10-y^10) / (x^100 - y^100) in [1,-1]
True
- sage: l = lcm(expand( (x^2+17*x+3/7*y)*(x^5 - 17*y + 2/3) ), expand((x^13+17*x+3/7*y)*(x^5 - 17*y + 2/3)) )
- sage: r = 1/21*(21*x^18 - 357*x^13*y + 14*x^13 + 357*x^6 + 9*x^5*y - 6069*x*y - 153*y^2 + 238*x + 6*y)*(21*x^7 + 357*x^6 + 9*x^5*y - 357*x^2*y + 14*x^2 - 6069*x*y - 153*y^2 + 238*x + 6*y)/(3*x^5 - 51*y + 2)
- sage: l / r in [1,-1]
+ sage: a = expand( (x^2+17*x+3/7*y)*(x^5 - 17*y + 2/3) )
+ sage: b = expand((x^13+17*x+3/7*y)*(x^5 - 17*y + 2/3) )
+ sage: gcd(a,b) * lcm(a,b) / (a * b) in [1,-1]
True
The result is not automatically simplified::
|