with the sample file...

2015-02-25 14:18 UTC+01:00, Vincent Delecroix <[email protected]>:
> Hello,
>
> In the attached sample file I wrote a function that behaves well with
> KeyboardInterrupt exceptions but not with OverflowError. More
> concretely
>
> sage: %runfile sig_on.pyx
> sage: test(2**50,2**30)     # Press Ctrl-C here
> ^C
> ...
> KeybordInterrupt
> sage: sig_on_count()
> 0
>
> So everything is looking fine... but
>
> sage: test(2**200, 2**100)
> Traceback
> ...
> OverflowError: long int too large to convert
> sage: sig_on_count()
> 1
>
> Is that the expected behavior?
>
> Vincent
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.
include "sage/ext/interrupt.pxi"

from sage.libs.gmp.mpz cimport mpz_bin_ui
from sage.rings.integer cimport Integer

def test(a,b):
    cdef Integer aa = <Integer?> a
    cdef Integer x = Integer.__new__(Integer)
    sig_on()
    mpz_bin_ui(x.value, aa.value, b)
    sig_off()
    return x

Reply via email to