@@ -19,7 +19,7 @@ from cpython.float cimport *
19
19
from cpython.complex cimport *
20
20
from cpython.number cimport *
21
21
22
- from cysignals.signals cimport sig_on, sig_off
22
+ from cysignals.signals cimport sig_check
23
23
24
24
from sage.ext.stdsage cimport PY_NEW
25
25
@@ -707,7 +707,6 @@ cdef class Context:
707
707
False
708
708
sage: isint(3+2j, gaussian=True)
709
709
True
710
-
711
710
"""
712
711
cdef MPF v
713
712
cdef MPF w
@@ -745,15 +744,23 @@ cdef class Context:
745
744
faster and produces more accurate results than the builtin
746
745
Python function :func:`sum`.
747
746
747
+ With squared=True each term is squared, and with absolute=True
748
+ the absolute value of each term is used.
749
+
748
750
TESTS ::
749
751
750
752
sage: from mpmath import mp, fsum
751
753
sage: mp.dps = 15; mp.pretty = False
752
754
sage: fsum([1, 2, 0.5, 7])
753
755
mpf('10.5')
754
756
755
- With squared=True each term is squared, and with absolute=True
756
- the absolute value of each term is used.
757
+ Check that the regression from `mpmath/issues/723 <https://github.com/mpmath/mpmath/issues/723>`__
758
+ has been fixed::
759
+
760
+ sage: from mpmath import *
761
+ sage: mp.dps=16
762
+ sage: zeta(-0.01 + 1000j)
763
+ mpc(real='-8.9714595...', imag='8.7321793...')
757
764
"""
758
765
cdef MPF sre, sim, tre, tim, tmp
759
766
cdef mpf rr
@@ -764,8 +771,8 @@ cdef class Context:
764
771
workopts.prec = workopts.prec * 2 + 50
765
772
workopts.rounding = ROUND_D
766
773
unknown = global_context.zero
767
- sig_on()
768
- try : # Way down, there is a ``finally`` with sig_off ()
774
+ try :
775
+ sig_check ()
769
776
MPF_init(& sre)
770
777
MPF_init(& sim)
771
778
MPF_init(& tre)
@@ -848,8 +855,8 @@ cdef class Context:
848
855
MPF_clear(& sre)
849
856
MPF_clear(& sim)
850
857
return + unknown
851
- finally :
852
- sig_off( )
858
+ except KeyboardInterrupt :
859
+ raise KeyboardInterrupt ( ' Ctlr-C has been pressed ' )
853
860
854
861
def fdot (ctx , A , B = None , bint conjugate = False ):
855
862
r """
0 commit comments