diff --git a/.gitignore b/.gitignore index 39fbfbe..4dd0c28 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ __pycache__/ *.py[co] # Cython output. -mpfr.c mpfr*.so # Build output (covers docs and extension build) diff --git a/mpfr.c b/mpfr.c new file mode 100644 index 0000000..617681b --- /dev/null +++ b/mpfr.c @@ -0,0 +1,60283 @@ +/* Generated by Cython 3.0.9 */ + +/* BEGIN: Cython Metadata +{ + "distutils": { + "depends": [], + "libraries": [ + "mpfr", + "gmp" + ], + "name": "mpfr", + "sources": [ + "mpfr.pyx" + ] + }, + "module_name": "mpfr" +} +END: Cython Metadata */ + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ +#if defined(CYTHON_LIMITED_API) && 0 + #ifndef Py_LIMITED_API + #if CYTHON_LIMITED_API+0 > 0x03030000 + #define Py_LIMITED_API CYTHON_LIMITED_API + #else + #define Py_LIMITED_API 0x03030000 + #endif + #endif +#endif + +#include "Python.h" +#ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) + #error Cython requires Python 2.7+ or Python 3.3+. +#else +#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API +#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#else +#define __PYX_EXTRA_ABI_MODULE_NAME "" +#endif +#define CYTHON_ABI "3_0_9" __PYX_EXTRA_ABI_MODULE_NAME +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." +#define CYTHON_HEX_VERSION 0x030009F0 +#define CYTHON_FUTURE_DIVISION 1 +#include +#ifndef offsetof + #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) +#endif +#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif + #ifndef __fastcall + #define __fastcall + #endif +#endif +#ifndef DL_IMPORT + #define DL_IMPORT(t) t +#endif +#ifndef DL_EXPORT + #define DL_EXPORT(t) t +#endif +#define __PYX_COMMA , +#ifndef HAVE_LONG_LONG + #define HAVE_LONG_LONG +#endif +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#ifndef Py_HUGE_VAL + #define Py_HUGE_VAL HUGE_VAL +#endif +#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX +#if defined(GRAALVM_PYTHON) + /* For very preliminary testing purposes. Most variables are set the same as PyPy. + The existence of this section does not imply that anything works or is even tested */ + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 1 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(PYPY_VERSION) + #define CYTHON_COMPILING_IN_PYPY 1 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #undef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #endif + #if PY_VERSION_HEX < 0x03090000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(CYTHON_LIMITED_API) + #ifdef Py_LIMITED_API + #undef __PYX_LIMITED_VERSION_HEX + #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API + #endif + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 1 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #undef CYTHON_CLINE_IN_TRACEBACK + #define CYTHON_CLINE_IN_TRACEBACK 0 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 0 + #undef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 1 + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #undef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #endif + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #undef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 0 + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #undef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #undef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 1 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #endif +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 0 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 1 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #undef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 0 + #ifndef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #undef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #undef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 +#else + #define CYTHON_COMPILING_IN_PYPY 0 + #define CYTHON_COMPILING_IN_CPYTHON 1 + #define CYTHON_COMPILING_IN_LIMITED_API 0 + #define CYTHON_COMPILING_IN_GRAAL 0 + #define CYTHON_COMPILING_IN_NOGIL 0 + #ifndef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif + #ifndef CYTHON_USE_PYTYPE_LOOKUP + #define CYTHON_USE_PYTYPE_LOOKUP 1 + #endif + #if PY_MAJOR_VERSION < 3 + #undef CYTHON_USE_ASYNC_SLOTS + #define CYTHON_USE_ASYNC_SLOTS 0 + #elif !defined(CYTHON_USE_ASYNC_SLOTS) + #define CYTHON_USE_ASYNC_SLOTS 1 + #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 1 + #endif + #ifndef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 1 + #endif + #ifndef CYTHON_USE_UNICODE_INTERNALS + #define CYTHON_USE_UNICODE_INTERNALS 1 + #endif + #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #undef CYTHON_USE_UNICODE_WRITER + #define CYTHON_USE_UNICODE_WRITER 0 + #elif !defined(CYTHON_USE_UNICODE_WRITER) + #define CYTHON_USE_UNICODE_WRITER 1 + #endif + #ifndef CYTHON_AVOID_BORROWED_REFS + #define CYTHON_AVOID_BORROWED_REFS 0 + #endif + #ifndef CYTHON_ASSUME_SAFE_MACROS + #define CYTHON_ASSUME_SAFE_MACROS 1 + #endif + #ifndef CYTHON_UNPACK_METHODS + #define CYTHON_UNPACK_METHODS 1 + #endif + #ifndef CYTHON_FAST_THREAD_STATE + #define CYTHON_FAST_THREAD_STATE 1 + #endif + #ifndef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #endif + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #endif + #ifndef CYTHON_FAST_PYCALL + #define CYTHON_FAST_PYCALL 1 + #endif + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif + #if PY_VERSION_HEX < 0x03050000 + #undef CYTHON_PEP489_MULTI_PHASE_INIT + #define CYTHON_PEP489_MULTI_PHASE_INIT 0 + #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #define CYTHON_PEP489_MULTI_PHASE_INIT 1 + #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif + #if PY_VERSION_HEX < 0x030400a1 + #undef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE 0 + #elif !defined(CYTHON_USE_TP_FINALIZE) + #define CYTHON_USE_TP_FINALIZE 1 + #endif + #if PY_VERSION_HEX < 0x030600B1 + #undef CYTHON_USE_DICT_VERSIONS + #define CYTHON_USE_DICT_VERSIONS 0 + #elif !defined(CYTHON_USE_DICT_VERSIONS) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #endif + #if PY_VERSION_HEX < 0x030700A3 + #undef CYTHON_USE_EXC_INFO_STACK + #define CYTHON_USE_EXC_INFO_STACK 0 + #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #define CYTHON_USE_EXC_INFO_STACK 1 + #endif + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif +#endif +#if !defined(CYTHON_FAST_PYCCALL) +#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#endif +#if !defined(CYTHON_VECTORCALL) +#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) +#endif +#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_MAJOR_VERSION < 3 + #include "longintrepr.h" + #endif + #undef SHIFT + #undef BASE + #undef MASK + #ifdef SIZEOF_VOID_P + enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; + #endif +#endif +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#ifndef __has_cpp_attribute + #define __has_cpp_attribute(x) 0 +#endif +#ifndef CYTHON_RESTRICT + #if defined(__GNUC__) + #define CYTHON_RESTRICT __restrict__ + #elif defined(_MSC_VER) && _MSC_VER >= 1400 + #define CYTHON_RESTRICT __restrict + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_RESTRICT restrict + #else + #define CYTHON_RESTRICT + #endif +#endif +#ifndef CYTHON_UNUSED + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(maybe_unused) + #define CYTHON_UNUSED [[maybe_unused]] + #endif + #endif + #endif +#endif +#ifndef CYTHON_UNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) +# else +# define CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_UNUSED_VAR +# if defined(__cplusplus) + template void CYTHON_UNUSED_VAR( const T& ) { } +# else +# define CYTHON_UNUSED_VAR(x) (void)(x) +# endif +#endif +#ifndef CYTHON_MAYBE_UNUSED_VAR + #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) +#endif +#ifndef CYTHON_NCP_UNUSED +# if CYTHON_COMPILING_IN_CPYTHON +# define CYTHON_NCP_UNUSED +# else +# define CYTHON_NCP_UNUSED CYTHON_UNUSED +# endif +#endif +#ifndef CYTHON_USE_CPP_STD_MOVE + #if defined(__cplusplus) && (\ + __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600)) + #define CYTHON_USE_CPP_STD_MOVE 1 + #else + #define CYTHON_USE_CPP_STD_MOVE 0 + #endif +#endif +#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +#ifdef _MSC_VER + #ifndef _MSC_STDINT_H_ + #if _MSC_VER < 1300 + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + #else + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + #endif + #endif + #if _MSC_VER < 1300 + #ifdef _WIN64 + typedef unsigned long long __pyx_uintptr_t; + #else + typedef unsigned int __pyx_uintptr_t; + #endif + #else + #ifdef _WIN64 + typedef unsigned __int64 __pyx_uintptr_t; + #else + typedef unsigned __int32 __pyx_uintptr_t; + #endif + #endif +#else + #include + typedef uintptr_t __pyx_uintptr_t; +#endif +#ifndef CYTHON_FALLTHROUGH + #if defined(__cplusplus) + /* for clang __has_cpp_attribute(fallthrough) is true even before C++17 + * but leads to warnings with -pedantic, since it is a C++17 feature */ + #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) + #if __has_cpp_attribute(fallthrough) + #define CYTHON_FALLTHROUGH [[fallthrough]] + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_cpp_attribute(clang::fallthrough) + #define CYTHON_FALLTHROUGH [[clang::fallthrough]] + #elif __has_cpp_attribute(gnu::fallthrough) + #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] + #endif + #endif + #endif + #ifndef CYTHON_FALLTHROUGH + #if __has_attribute(fallthrough) + #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) + #else + #define CYTHON_FALLTHROUGH + #endif + #endif + #if defined(__clang__) && defined(__apple_build_version__) + #if __apple_build_version__ < 7000000 + #undef CYTHON_FALLTHROUGH + #define CYTHON_FALLTHROUGH + #endif + #endif +#endif +#ifdef __cplusplus + template + struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; + #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value) +#else + #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0) +#endif +#if CYTHON_COMPILING_IN_PYPY == 1 + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000) +#else + #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000) +#endif +#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) + +#ifndef CYTHON_INLINE + #if defined(__clang__) + #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) + #elif defined(__GNUC__) + #define CYTHON_INLINE __inline__ + #elif defined(_MSC_VER) + #define CYTHON_INLINE __inline + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define CYTHON_INLINE inline + #else + #define CYTHON_INLINE + #endif +#endif + +#define __PYX_BUILD_PY_SSIZE_T "n" +#define CYTHON_FORMAT_SSIZE_T "z" +#if PY_MAJOR_VERSION < 3 + #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" + #define __Pyx_DefaultClassType PyClass_Type + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define __Pyx_DefaultClassType PyType_Type +#if CYTHON_COMPILING_IN_LIMITED_API + static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyObject *exception_table = NULL; + PyObject *types_module=NULL, *code_type=NULL, *result=NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 + PyObject *version_info; + PyObject *py_minor_version = NULL; + #endif + long minor_version = 0; + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 + minor_version = 11; + #else + if (!(version_info = PySys_GetObject("version_info"))) goto end; + if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; + minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); + if (minor_version == -1 && PyErr_Occurred()) goto end; + #endif + if (!(types_module = PyImport_ImportModule("types"))) goto end; + if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; + if (minor_version <= 7) { + (void)p; + result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else if (minor_version <= 10) { + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, fline, lnos, fv, cell); + } else { + if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; + result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, + c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); + } + end: + Py_XDECREF(code_type); + Py_XDECREF(exception_table); + Py_XDECREF(types_module); + if (type) { + PyErr_Restore(type, value, traceback); + } + return result; + } + #ifndef CO_OPTIMIZED + #define CO_OPTIMIZED 0x0001 + #endif + #ifndef CO_NEWLOCALS + #define CO_NEWLOCALS 0x0002 + #endif + #ifndef CO_VARARGS + #define CO_VARARGS 0x0004 + #endif + #ifndef CO_VARKEYWORDS + #define CO_VARKEYWORDS 0x0008 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x0200 + #endif + #ifndef CO_GENERATOR + #define CO_GENERATOR 0x0020 + #endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x0080 + #endif +#elif PY_VERSION_HEX >= 0x030B0000 + static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, + PyObject *code, PyObject *c, PyObject* n, PyObject *v, + PyObject *fv, PyObject *cell, PyObject* fn, + PyObject *name, int fline, PyObject *lnos) { + PyCodeObject *result; + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); + if (!empty_bytes) return NULL; + result = + #if PY_VERSION_HEX >= 0x030C0000 + PyUnstable_Code_NewWithPosOnlyArgs + #else + PyCode_NewWithPosOnlyArgs + #endif + (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); + Py_DECREF(empty_bytes); + return result; + } +#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#else + #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ + PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) +#endif +#endif +#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) + #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) +#else + #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is) + #define __Pyx_Py_Is(x, y) Py_Is(x, y) +#else + #define __Pyx_Py_Is(x, y) ((x) == (y)) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone) + #define __Pyx_Py_IsNone(ob) Py_IsNone(ob) +#else + #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue) + #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob) +#else + #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True) +#endif +#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse) + #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob) +#else + #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False) +#endif +#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj)) +#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o) +#else + #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) +#endif +#ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 +#endif +#ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 +#endif +#ifndef Py_TPFLAGS_CHECKTYPES + #define Py_TPFLAGS_CHECKTYPES 0 +#endif +#ifndef Py_TPFLAGS_HAVE_INDEX + #define Py_TPFLAGS_HAVE_INDEX 0 +#endif +#ifndef Py_TPFLAGS_HAVE_NEWBUFFER + #define Py_TPFLAGS_HAVE_NEWBUFFER 0 +#endif +#ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 +#endif +#ifndef Py_TPFLAGS_SEQUENCE + #define Py_TPFLAGS_SEQUENCE 0 +#endif +#ifndef Py_TPFLAGS_MAPPING + #define Py_TPFLAGS_MAPPING 0 +#endif +#ifndef METH_STACKLESS + #define METH_STACKLESS 0 +#endif +#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) + #ifndef METH_FASTCALL + #define METH_FASTCALL 0x80 + #endif + typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); + typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, + Py_ssize_t nargs, PyObject *kwnames); +#else + #if PY_VERSION_HEX >= 0x030d00A4 + # define __Pyx_PyCFunctionFast PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords + #else + # define __Pyx_PyCFunctionFast _PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #endif +#endif +#if CYTHON_METH_FASTCALL + #define __Pyx_METH_FASTCALL METH_FASTCALL + #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast + #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords +#else + #define __Pyx_METH_FASTCALL METH_VARARGS + #define __Pyx_PyCFunction_FastCall PyCFunction + #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords +#endif +#if CYTHON_VECTORCALL + #define __pyx_vectorcallfunc vectorcallfunc + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET + #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n)) +#elif CYTHON_BACKPORT_VECTORCALL + typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args, + size_t nargsf, PyObject *kwnames); + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1)) + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)) +#else + #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 + #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) +#endif +#if PY_MAJOR_VERSION >= 0x030900B1 +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) +#else +#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) +#endif +#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func) +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth) +#elif !CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func) +#endif +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags) +static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { + return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; +} +#endif +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +#if CYTHON_COMPILING_IN_LIMITED_API + return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; +#else + return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +#endif +} +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) +#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) + typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); +#else + #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b) + #define __Pyx_PyCMethod PyCMethod +#endif +#ifndef METH_METHOD + #define METH_METHOD 0x200 +#endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) + #define PyObject_Malloc(s) PyMem_Malloc(s) + #define PyObject_Free(p) PyMem_Free(p) + #define PyObject_Realloc(p) PyMem_Realloc(p) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#else + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyThreadState_Current PyThreadState_Get() +#elif !CYTHON_FAST_THREAD_STATE + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#elif PY_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() +#elif PY_VERSION_HEX >= 0x03060000 + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() +#elif PY_VERSION_HEX >= 0x03000000 + #define __Pyx_PyThreadState_Current PyThreadState_GET() +#else + #define __Pyx_PyThreadState_Current _PyThreadState_Current +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +{ + void *result; + result = PyModule_GetState(op); + if (!result) + Py_FatalError("Couldn't find the module state"); + return result; +} +#endif +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) +#endif +#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) +#include "pythread.h" +#define Py_tss_NEEDS_INIT 0 +typedef int Py_tss_t; +static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { + *key = PyThread_create_key(); + return 0; +} +static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { + Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); + *key = Py_tss_NEEDS_INIT; + return key; +} +static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { + PyObject_Free(key); +} +static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { + return *key != Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { + PyThread_delete_key(*key); + *key = Py_tss_NEEDS_INIT; +} +static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { + return PyThread_set_key_value(*key, value); +} +static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { + return PyThread_get_key_value(*key); +} +#endif +#if PY_MAJOR_VERSION < 3 + #if CYTHON_COMPILING_IN_PYPY + #if PYPY_VERSION_NUM < 0x07030600 + #if defined(__cplusplus) && __cplusplus >= 201402L + [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] + #elif defined(__GNUC__) || defined(__clang__) + __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) + #elif defined(_MSC_VER) + __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) + #endif + static CYTHON_INLINE int PyGILState_Check(void) { + return 0; + } + #else // PYPY_VERSION_NUM < 0x07030600 + #endif // PYPY_VERSION_NUM < 0x07030600 + #else + static CYTHON_INLINE int PyGILState_Check(void) { + PyThreadState * tstate = _PyThreadState_Current; + return tstate && (tstate == PyGILState_GetThisThreadState()); + } + #endif +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) +#else +#define __Pyx_PyDict_NewPresized(n) PyDict_New() +#endif +#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION + #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#else + #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) + #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { + PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); + if (res == NULL) PyErr_Clear(); + return res; +} +#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#else +static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) { +#if CYTHON_COMPILING_IN_PYPY + return PyDict_GetItem(dict, name); +#else + PyDictEntry *ep; + PyDictObject *mp = (PyDictObject*) dict; + long hash = ((PyStringObject *) name)->ob_shash; + assert(hash != -1); + ep = (mp->ma_lookup)(mp, name, hash); + if (ep == NULL) { + return NULL; + } + return ep->me_value; +#endif +} +#define __Pyx_PyDict_GetItemStr PyDict_GetItem +#endif +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) + #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) + #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) +#else + #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) + #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) + #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) +#else + #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) +#endif +#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 +#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ + assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ + PyObject_GC_Del(obj);\ + Py_DECREF(type);\ +} +#else +#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) +#endif +#if CYTHON_COMPILING_IN_LIMITED_API + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) + #define __Pyx_PyUnicode_DATA(u) ((void*)u) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) +#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_READY(op) (0) + #else + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #endif + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch) + #if PY_VERSION_HEX >= 0x030C0000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u)) + #else + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000 + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length)) + #else + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #endif + #endif +#else + #define CYTHON_PEP393_ENABLED 0 + #define PyUnicode_1BYTE_KIND 1 + #define PyUnicode_2BYTE_KIND 2 + #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) + #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) + #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) + #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) + #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) +#else + #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) + #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ + PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) +#endif +#if CYTHON_COMPILING_IN_PYPY + #if !defined(PyUnicode_DecodeUnicodeEscape) + #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) + #endif + #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) + #undef PyUnicode_Contains + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif + #if !defined(PyByteArray_Check) + #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) + #endif + #if !defined(PyObject_Format) + #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) + #endif +#endif +#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) +#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) +#else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) +#endif +#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) + #define PyObject_ASCII(o) PyObject_Repr(o) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject + #define PyString_Type PyUnicode_Type + #define PyString_Check PyUnicode_Check + #define PyString_CheckExact PyUnicode_CheckExact +#ifndef PyObject_Unicode + #define PyObject_Unicode PyObject_Str +#endif +#endif +#if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) + #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) +#else + #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) + #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) +#endif +#if CYTHON_COMPILING_IN_CPYTHON + #define __Pyx_PySequence_ListKeepNew(obj)\ + (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) +#else + #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj) +#endif +#ifndef PySet_CheckExact + #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type) +#endif +#if PY_VERSION_HEX >= 0x030900A4 + #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size) +#else + #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) + #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) +#endif +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) + #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) + #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) + #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) + #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) + #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) +#else + static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { + PyObject *module = PyImport_AddModule(name); + Py_XINCREF(module); + return module; + } +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type + #define PyInt_Check(op) PyLong_Check(op) + #define PyInt_CheckExact(op) PyLong_CheckExact(op) + #define __Pyx_Py3Int_Check(op) PyLong_Check(op) + #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) + #define PyInt_FromString PyLong_FromString + #define PyInt_FromUnicode PyLong_FromUnicode + #define PyInt_FromLong PyLong_FromLong + #define PyInt_FromSize_t PyLong_FromSize_t + #define PyInt_FromSsize_t PyLong_FromSsize_t + #define PyInt_AsLong PyLong_AsLong + #define PyInt_AS_LONG PyLong_AS_LONG + #define PyInt_AsSsize_t PyLong_AsSsize_t + #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask + #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask + #define PyNumber_Int PyNumber_Long +#else + #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) + #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) +#endif +#if PY_MAJOR_VERSION >= 3 + #define PyBoolObject PyLongObject +#endif +#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY + #ifndef PyUnicode_InternFromString + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) + #endif +#endif +#if PY_VERSION_HEX < 0x030200A4 + typedef long Py_hash_t; + #define __Pyx_PyInt_FromHash_t PyInt_FromLong + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#else + #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t + #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t +#endif +#if CYTHON_USE_ASYNC_SLOTS + #if PY_VERSION_HEX >= 0x030500B1 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods + #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else + #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif +#else + #define __Pyx_PyType_AsAsync(obj) NULL +#endif +#ifndef __Pyx_PyAsyncMethodsStruct + typedef struct { + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; + } __Pyx_PyAsyncMethodsStruct; +#endif + +#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) + #if !defined(_USE_MATH_DEFINES) + #define _USE_MATH_DEFINES + #endif +#endif +#include +#ifdef NAN +#define __PYX_NAN() ((float) NAN) +#else +static CYTHON_INLINE float __PYX_NAN() { + float value; + memset(&value, 0xFF, sizeof(value)); + return value; +} +#endif +#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) +#define __Pyx_truncl trunc +#else +#define __Pyx_truncl truncl +#endif + +#define __PYX_MARK_ERR_POS(f_index, lineno) \ + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#define __PYX_ERR(f_index, lineno, Ln_error) \ + { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } + +#ifdef CYTHON_EXTERN_C + #undef __PYX_EXTERN_C + #define __PYX_EXTERN_C CYTHON_EXTERN_C +#elif defined(__PYX_EXTERN_C) + #ifdef _MSC_VER + #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.") + #else + #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead. + #endif +#else + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" + #else + #define __PYX_EXTERN_C extern + #endif +#endif + +#define __PYX_HAVE__mpfr +#define __PYX_HAVE_API__mpfr +/* Early includes */ +#include +#include +#include "gmp.h" +#include "stdio.h" +#include "mpfr.h" +#include "limits.h" +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif + +typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + +#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 +#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) +#define __PYX_DEFAULT_STRING_ENCODING "" +#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString +#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#define __Pyx_uchar_cast(c) ((unsigned char)c) +#define __Pyx_long_cast(x) ((long)x) +#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ + (sizeof(type) < sizeof(Py_ssize_t)) ||\ + (sizeof(type) > sizeof(Py_ssize_t) &&\ + likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX) &&\ + (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ + v == (type)PY_SSIZE_T_MIN))) ||\ + (sizeof(type) == sizeof(Py_ssize_t) &&\ + (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ + v == (type)PY_SSIZE_T_MAX))) ) +static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { + return (size_t) i < (size_t) limit; +} +#if defined (__cplusplus) && __cplusplus >= 201103L + #include + #define __Pyx_sst_abs(value) std::abs(value) +#elif SIZEOF_INT >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) abs(value) +#elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +#elif defined (_MSC_VER) + #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) +#elif defined (__GNUC__) + #define __Pyx_sst_abs(value) __builtin_llabs(value) +#else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) +#endif +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s); +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); +#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) +#define __Pyx_PyBytes_FromString PyBytes_FromString +#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); +#if PY_MAJOR_VERSION < 3 + #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize +#else + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize +#endif +#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) +#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) +#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) +#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) +#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) +#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) +#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) +#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +#define __Pyx_PySequence_Tuple(obj)\ + (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); +#if CYTHON_ASSUME_SAFE_MACROS +#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#else +#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#endif +#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) +#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) +#else +#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) +#endif +#if CYTHON_USE_PYLONG_INTERNALS + #if PY_VERSION_HEX >= 0x030C00A7 + #ifndef _PyLong_SIGN_MASK + #define _PyLong_SIGN_MASK 3 + #endif + #ifndef _PyLong_NON_SIZE_BITS + #define _PyLong_NON_SIZE_BITS 3 + #endif + #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK) + #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0) + #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x)) + #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1) + #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_SignedDigitCount(x)\ + ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x)) + #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue) + #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x) + #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x) + #else + #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS)) + #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0]) + #endif + typedef Py_ssize_t __Pyx_compact_pylong; + typedef size_t __Pyx_compact_upylong; + #else + #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) + #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) + #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) + #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0) + #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0]) + #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x)) + #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x) + #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1) + #define __Pyx_PyLong_CompactValue(x)\ + ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0])) + typedef sdigit __Pyx_compact_pylong; + typedef digit __Pyx_compact_upylong; + #endif + #if PY_VERSION_HEX >= 0x030C00A5 + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit) + #else + #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) + #endif +#endif +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#include +static int __Pyx_sys_getdefaultencoding_not_ascii; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + PyObject* ascii_chars_u = NULL; + PyObject* ascii_chars_b = NULL; + const char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + if (strcmp(default_encoding_c, "ascii") == 0) { + __Pyx_sys_getdefaultencoding_not_ascii = 0; + } else { + char ascii_chars[128]; + int c; + for (c = 0; c < 128; c++) { + ascii_chars[c] = (char) c; + } + __Pyx_sys_getdefaultencoding_not_ascii = 1; + ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); + if (!ascii_chars_u) goto bad; + ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); + if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { + PyErr_Format( + PyExc_ValueError, + "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", + default_encoding_c); + goto bad; + } + Py_DECREF(ascii_chars_u); + Py_DECREF(ascii_chars_b); + } + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + Py_XDECREF(ascii_chars_u); + Py_XDECREF(ascii_chars_b); + return -1; +} +#endif +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#else +#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#include +static char* __PYX_DEFAULT_STRING_ENCODING; +static int __Pyx_init_sys_getdefaultencoding_params(void) { + PyObject* sys; + PyObject* default_encoding = NULL; + char* default_encoding_c; + sys = PyImport_ImportModule("sys"); + if (!sys) goto bad; + default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); + Py_DECREF(sys); + if (!default_encoding) goto bad; + default_encoding_c = PyBytes_AsString(default_encoding); + if (!default_encoding_c) goto bad; + __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); + if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; + strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); + Py_DECREF(default_encoding); + return 0; +bad: + Py_XDECREF(default_encoding); + return -1; +} +#endif +#endif + + +/* Test for GCC > 2.95 */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) + #define likely(x) __builtin_expect(!!(x), 1) + #define unlikely(x) __builtin_expect(!!(x), 0) +#else /* !__GNUC__ or GCC < 2.95 */ + #define likely(x) (x) + #define unlikely(x) (x) +#endif /* __GNUC__ */ +static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +#if !CYTHON_USE_MODULE_STATE +static PyObject *__pyx_m = NULL; +#endif +static int __pyx_lineno; +static int __pyx_clineno = 0; +static const char * __pyx_cfilenm = __FILE__; +static const char *__pyx_filename; + +/* #### Code section: filename_table ### */ + +static const char *__pyx_f[] = { + "", + "mpfr.pyx", +}; +/* #### Code section: utility_code_proto_before_types ### */ +/* ForceInitThreads.proto */ +#ifndef __PYX_FORCE_INIT_THREADS + #define __PYX_FORCE_INIT_THREADS 0 +#endif + +/* #### Code section: numeric_typedefs ### */ +/* #### Code section: complex_type_declarations ### */ +/* #### Code section: type_declarations ### */ + +/*--- Type declarations ---*/ +struct __pyx_obj_4mpfr_Mpz_t; +struct __pyx_obj_4mpfr_Mpfr_t; + +/* "mpfr.pyx":40 + * ############################################################################### + * + * cdef class Mpz_t: # <<<<<<<<<<<<<< + * """ + * GMP integer object. + */ +struct __pyx_obj_4mpfr_Mpz_t { + PyObject_HEAD + __mpz_struct _value; +}; + + +/* "mpfr.pyx":177 + * + * # Forward declaration + * cdef class Mpfr_t # <<<<<<<<<<<<<< + * + * # Checks for valid parameter ranges + */ +struct __pyx_obj_4mpfr_Mpfr_t { + PyObject_HEAD + __mpfr_struct _value; +}; + +/* #### Code section: utility_code_proto ### */ + +/* --- Runtime support code (head) --- */ +/* Refnanny.proto */ +#ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 +#endif +#if CYTHON_REFNANNY + typedef struct { + void (*INCREF)(void*, PyObject*, Py_ssize_t); + void (*DECREF)(void*, PyObject*, Py_ssize_t); + void (*GOTREF)(void*, PyObject*, Py_ssize_t); + void (*GIVEREF)(void*, PyObject*, Py_ssize_t); + void* (*SetupContext)(const char*, Py_ssize_t, const char*); + void (*FinishContext)(void**); + } __Pyx_RefNannyAPIStruct; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); + #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; +#ifdef WITH_THREAD + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + if (acquire_gil) {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + PyGILState_Release(__pyx_gilstate_save);\ + } else {\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\ + } + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } +#else + #define __Pyx_RefNannySetupContext(name, acquire_gil)\ + __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) + #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() +#endif + #define __Pyx_RefNannyFinishContextNogil() {\ + PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ + __Pyx_RefNannyFinishContext();\ + PyGILState_Release(__pyx_gilstate_save);\ + } + #define __Pyx_RefNannyFinishContext()\ + __Pyx_RefNanny->FinishContext(&__pyx_refnanny) + #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__)) + #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0) + #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0) + #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0) + #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0) +#else + #define __Pyx_RefNannyDeclarations + #define __Pyx_RefNannySetupContext(name, acquire_gil) + #define __Pyx_RefNannyFinishContextNogil() + #define __Pyx_RefNannyFinishContext() + #define __Pyx_INCREF(r) Py_INCREF(r) + #define __Pyx_DECREF(r) Py_DECREF(r) + #define __Pyx_GOTREF(r) + #define __Pyx_GIVEREF(r) + #define __Pyx_XINCREF(r) Py_XINCREF(r) + #define __Pyx_XDECREF(r) Py_XDECREF(r) + #define __Pyx_XGOTREF(r) + #define __Pyx_XGIVEREF(r) +#endif +#define __Pyx_Py_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; Py_XDECREF(tmp);\ + } while (0) +#define __Pyx_XDECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_XDECREF(tmp);\ + } while (0) +#define __Pyx_DECREF_SET(r, v) do {\ + PyObject *tmp = (PyObject *) r;\ + r = v; __Pyx_DECREF(tmp);\ + } while (0) +#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) +#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +/* PyErrExceptionMatches.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) +static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); +#else +#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) +#endif + +/* PyThreadStateGet.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; +#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; +#if PY_VERSION_HEX >= 0x030C00A6 +#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL) +#else +#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL) +#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type) +#endif +#else +#define __Pyx_PyThreadState_declare +#define __Pyx_PyThreadState_assign +#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL) +#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred() +#endif + +/* PyErrFetchRestore.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) +#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6 +#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) +#else +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#endif +#else +#define __Pyx_PyErr_Clear() PyErr_Clear() +#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) +#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) +#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) +#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) +#endif + +/* PyObjectGetAttrStr.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) +#endif + +/* PyObjectGetAttrStrNoError.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name); + +/* GetBuiltinName.proto */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +/* TupleAndListFromArray.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); +#endif + +/* IncludeStringH.proto */ +#include + +/* BytesEquals.proto */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); + +/* UnicodeEquals.proto */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); + +/* fastcall.proto */ +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) +#elif CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) +#else + #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) +#endif +#if CYTHON_AVOID_BORROWED_REFS + #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) + #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) +#else + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) +#define __Pyx_KwValues_VARARGS(args, nargs) NULL +#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) +#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) +#if CYTHON_METH_FASTCALL + #define __Pyx_Arg_FASTCALL(args, i) args[i] + #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) + static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + #else + #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) + #endif + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) +#else + #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS + #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS + #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS + #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS + #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) + #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) +#endif +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) +#else +#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) +#endif + +/* RaiseArgTupleInvalid.proto */ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + +/* KeywordStringCheck.proto */ +static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed); + +/* RaiseException.proto */ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +/* RaiseDoubleKeywords.proto */ +static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + +/* ParseKeywords.proto */ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, + const char* function_name); + +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* PyObjectCall.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); +#else +#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) +#endif + +/* PyFunctionFastCall.proto */ +#if CYTHON_FAST_PYCALL +#if !CYTHON_VECTORCALL +#define __Pyx_PyFunction_FastCall(func, args, nargs)\ + __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +#endif +#define __Pyx_BUILD_ASSERT_EXPR(cond)\ + (sizeof(char [1 - 2*!(cond)]) - 1) +#ifndef Py_MEMBER_SIZE +#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) +#endif +#if !CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03080000 + #include "frameobject.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif + #define __Pxy_PyFrame_Initialize_Offsets() + #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) +#else + static size_t __pyx_pyframe_localsplus_offset = 0; + #include "frameobject.h" + #define __Pxy_PyFrame_Initialize_Offsets()\ + ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ + (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) + #define __Pyx_PyFrame_GetLocalsplus(frame)\ + (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) +#endif +#endif +#endif + +/* PyObjectCallMethO.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +/* PyObjectFastCall.proto */ +#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); + +/* RaiseUnexpectedTypeError.proto */ +static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); + +/* PyObjectCallOneArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* SwapException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* GetTopmostException.proto */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); +#endif + +/* SaveResetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); +#else +#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) +#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) +#endif + +/* PyDictVersioning.proto */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) +#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ + (version_var) = __PYX_GET_DICT_VERSION(dict);\ + (cache_var) = (value); +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ + (VAR) = __pyx_dict_cached_value;\ + } else {\ + (VAR) = __pyx_dict_cached_value = (LOOKUP);\ + __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ + }\ +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); +#else +#define __PYX_GET_DICT_VERSION(dict) (0) +#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) +#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); +#endif + +/* GetModuleGlobalName.proto */ +#if CYTHON_USE_DICT_VERSIONS +#define __Pyx_GetModuleGlobalName(var, name) do {\ + static PY_UINT64_T __pyx_dict_version = 0;\ + static PyObject *__pyx_dict_cached_value = NULL;\ + (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ + (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ + __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\ + PY_UINT64_T __pyx_dict_version;\ + PyObject *__pyx_dict_cached_value;\ + (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ +} while(0) +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); +#else +#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) +#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); +#endif + +/* decode_c_string_utf16.proto */ +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 0; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = -1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} +static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { + int byteorder = 1; + return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); +} + +/* decode_c_bytes.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( + const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* decode_bytes.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_bytes( + PyObject* string, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + char* as_c_string; + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + as_c_string = PyBytes_AS_STRING(string); + size = PyBytes_GET_SIZE(string); +#else + if (PyBytes_AsStringAndSize(string, &as_c_string, &size) < 0) { + return NULL; + } +#endif + return __Pyx_decode_c_bytes( + as_c_string, size, + start, stop, encoding, errors, decode_func); +} + +/* WriteUnraisableException.proto */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +/* GetItemInt.proto */ +#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ + (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ + __Pyx_GetItemInt_Generic(o, to_py_func(i)))) +#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + +/* ExtTypeTest.proto */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; + +/* CallUnboundCMethod0.proto */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_CallUnboundCMethod0(cfunc, self)\ + (likely((cfunc)->func) ?\ + (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ + (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ + (PY_VERSION_HEX >= 0x030700A0 ?\ + (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ + (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ + (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ + (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ + ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ + __Pyx__CallUnboundCMethod0(cfunc, self)) +#else +#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) +#endif + +/* IncludeStructmemberH.proto */ +#include + +/* FixUpExtensionType.proto */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type); +#endif + +/* PyObjectCallNoArg.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + +/* PyObjectGetMethod.proto */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); + +/* PyObjectCallMethod0.proto */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name); + +/* ValidateBasesTuple.proto */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases); +#endif + +/* PyType_Ready.proto */ +CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t); + +/* PyObject_GenericGetAttrNoDict.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr +#endif + +/* PyObject_GenericGetAttr.proto */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); +#else +#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr +#endif + +/* SetupReduce.proto */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_setup_reduce(PyObject* type_obj); +#endif + +/* Import.proto */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + +/* ImportDottedModule.proto */ +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple); +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple); +#endif + +/* FetchSharedCythonModule.proto */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void); + +/* FetchCommonType.proto */ +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); +#else +static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases); +#endif + +/* PyMethodNew.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + PyObject *typesModule=NULL, *methodType=NULL, *result=NULL; + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + typesModule = PyImport_ImportModule("types"); + if (!typesModule) return NULL; + methodType = PyObject_GetAttrString(typesModule, "MethodType"); + Py_DECREF(typesModule); + if (!methodType) return NULL; + result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL); + Py_DECREF(methodType); + return result; +} +#elif PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) { + CYTHON_UNUSED_VAR(typ); + if (!self) + return __Pyx_NewRef(func); + return PyMethod_New(func, self); +} +#else + #define __Pyx_PyMethod_New PyMethod_New +#endif + +/* PyVectorcallFastCallDict.proto */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw); +#endif + +/* CythonFunctionShared.proto */ +#define __Pyx_CyFunction_USED +#define __Pyx_CYFUNCTION_STATICMETHOD 0x01 +#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 +#define __Pyx_CYFUNCTION_CCLASS 0x04 +#define __Pyx_CYFUNCTION_COROUTINE 0x08 +#define __Pyx_CyFunction_GetClosure(f)\ + (((__pyx_CyFunctionObject *) (f))->func_closure) +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + #define __Pyx_CyFunction_GetClassObj(f)\ + (((__pyx_CyFunctionObject *) (f))->func_classobj) +#else + #define __Pyx_CyFunction_GetClassObj(f)\ + ((PyObject*) ((PyCMethodObject *) (f))->mm_class) +#endif +#define __Pyx_CyFunction_SetClassObj(f, classobj)\ + __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj)) +#define __Pyx_CyFunction_Defaults(type, f)\ + ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) +#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ + ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) +typedef struct { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject_HEAD + PyObject *func; +#elif PY_VERSION_HEX < 0x030900B1 + PyCFunctionObject func; +#else + PyCMethodObject func; +#endif +#if CYTHON_BACKPORT_VECTORCALL + __pyx_vectorcallfunc func_vectorcall; +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_weakreflist; +#endif + PyObject *func_dict; + PyObject *func_name; + PyObject *func_qualname; + PyObject *func_doc; + PyObject *func_globals; + PyObject *func_code; + PyObject *func_closure; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + PyObject *func_classobj; +#endif + void *defaults; + int defaults_pyobjects; + size_t defaults_size; + int flags; + PyObject *defaults_tuple; + PyObject *defaults_kwdict; + PyObject *(*defaults_getter)(PyObject *); + PyObject *func_annotations; + PyObject *func_is_coroutine; +} __pyx_CyFunctionObject; +#undef __Pyx_CyOrPyCFunction_Check +#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType) +#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type) +#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType) +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc); +#undef __Pyx_IsSameCFunction +#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc) +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj); +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, + size_t size, + int pyobjects); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, + PyObject *tuple); +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, + PyObject *dict); +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, + PyObject *dict); +static int __pyx_CyFunction_init(PyObject *module); +#if CYTHON_METH_FASTCALL +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames); +#if CYTHON_BACKPORT_VECTORCALL +#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall) +#else +#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall) +#endif +#endif + +/* CythonFunction.proto */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, + int flags, PyObject* qualname, + PyObject *closure, + PyObject *module, PyObject *globals, + PyObject* code); + +/* decode_c_string.proto */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); + +/* CLineInTraceback.proto */ +#ifdef CYTHON_CLINE_IN_TRACEBACK +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) +#else +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#endif + +/* CodeObjectCache.proto */ +#if !CYTHON_COMPILING_IN_LIMITED_API +typedef struct { + PyCodeObject* code_object; + int code_line; +} __Pyx_CodeObjectCacheEntry; +struct __Pyx_CodeObjectCache { + int count; + int max_count; + __Pyx_CodeObjectCacheEntry* entries; +}; +static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); +static PyCodeObject *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); +#endif + +/* AddTraceback.proto */ +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + +/* GCCDiagnostics.proto */ +#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) +#define __Pyx_HAS_GCC_DIAGNOSTIC +#endif + +/* CIntFromPy.proto */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mpfr_prec_t(mpfr_prec_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mpfr_rnd_t(mpfr_rnd_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mpfr_free_cache_t(mpfr_free_cache_t value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE mpfr_free_cache_t __Pyx_PyInt_As_mpfr_free_cache_t(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mp_exp_t(mp_exp_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mpfr_flags_t(mpfr_flags_t value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE mpfr_prec_t __Pyx_PyInt_As_mpfr_prec_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE mpfr_rnd_t __Pyx_PyInt_As_mpfr_rnd_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE mp_exp_t __Pyx_PyInt_As_mp_exp_t(PyObject *); + +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE mpfr_flags_t __Pyx_PyInt_As_mpfr_flags_t(PyObject *); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value); + +/* CIntToPy.proto */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); + +/* CIntFromPy.proto */ +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); + +/* FormatTypeName.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%U" +static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); +#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#else +typedef const char *__Pyx_TypeName; +#define __Pyx_FMT_TYPENAME "%.200s" +#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_DECREF_TypeName(obj) +#endif + +/* FastTypeChecks.proto */ +#if CYTHON_COMPILING_IN_CPYTHON +#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2) +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); +#else +#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) +#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) +#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) +#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +#endif +#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) +#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) + +/* CheckBinaryVersion.proto */ +static unsigned long __Pyx_get_runtime_version(void); +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); + +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + +/* #### Code section: module_declarations ### */ + +/* Module declarations from "libc.string" */ + +/* Module declarations from "libc.stdlib" */ + +/* Module declarations from "libc" */ + +/* Module declarations from "cgmp" */ + +/* Module declarations from "cmpfr" */ + +/* Module declarations from "mpfr" */ +static mpfr_free_cache_t __pyx_v_4mpfr_MPFR_FREE_CACHE_ALL; +static int __pyx_f_4mpfr_check_rounding_mode(mpfr_rnd_t); /*proto*/ +static int __pyx_f_4mpfr_check_cache_flags(mpfr_free_cache_t); /*proto*/ +static int __pyx_f_4mpfr_check_base(int, int); /*proto*/ +static int __pyx_f_4mpfr_check_get_str_n(int, size_t); /*proto*/ +static int __pyx_f_4mpfr_check_precision(mpfr_prec_t); /*proto*/ +static int __pyx_f_4mpfr_check_initialized(struct __pyx_obj_4mpfr_Mpfr_t *); /*proto*/ +static int __pyx_f_4mpfr_check_not_initialized(struct __pyx_obj_4mpfr_Mpfr_t *); /*proto*/ +static int __pyx_f_4mpfr_check_flag_mask(mpfr_flags_t); /*proto*/ +static PyObject *__pyx_f_4mpfr_decode_ternary_pair(int); /*proto*/ +static int __pyx_f_4mpfr_cmpfr_initialized_p(mpfr_ptr); /*proto*/ +/* #### Code section: typeinfo ### */ +/* #### Code section: before_global_var ### */ +#define __Pyx_MODULE_NAME "mpfr" +extern int __pyx_module_is_main_mpfr; +int __pyx_module_is_main_mpfr = 0; + +/* Implementation of "mpfr" */ +/* #### Code section: global_var ### */ +static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_ValueError; +static PyObject *__pyx_builtin_RuntimeError; +static PyObject *__pyx_builtin_DeprecationWarning; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_range; +/* #### Code section: string_decls ### */ +static const char __pyx_k_b[] = "b"; +static const char __pyx_k_d[] = "d"; +static const char __pyx_k_e[] = "e"; +static const char __pyx_k_i[] = "i"; +static const char __pyx_k_k[] = "k"; +static const char __pyx_k_n[] = "n"; +static const char __pyx_k_r[] = "r"; +static const char __pyx_k_s[] = "s"; +static const char __pyx_k_t[] = "t"; +static const char __pyx_k_x[] = "x"; +static const char __pyx_k_y[] = "y"; +static const char __pyx_k_gc[] = "gc"; +static const char __pyx_k_op[] = "op"; +static const char __pyx_k_rc[] = "rc"; +static const char __pyx_k_rv[] = "rv"; +static const char __pyx_k__12[] = "*"; +static const char __pyx_k_arg[] = "arg"; +static const char __pyx_k_cop[] = "cop"; +static const char __pyx_k_elt[] = "elt"; +static const char __pyx_k_err[] = "err"; +static const char __pyx_k_exp[] = "exp"; +static const char __pyx_k_fop[] = "fop"; +static const char __pyx_k_iop[] = "iop"; +static const char __pyx_k_op1[] = "op1"; +static const char __pyx_k_op2[] = "op2"; +static const char __pyx_k_op3[] = "op3"; +static const char __pyx_k_op4[] = "op4"; +static const char __pyx_k_rnd[] = "rnd"; +static const char __pyx_k_rop[] = "rop"; +static const char __pyx_k_sop[] = "sop"; +static const char __pyx_k_sys[] = "sys"; +static const char __pyx_k_tab[] = "tab"; +static const char __pyx_k_way[] = "way"; +static const char __pyx_k__283[] = "?"; +static const char __pyx_k_args[] = "args"; +static const char __pyx_k_base[] = "base"; +static const char __pyx_k_main[] = "__main__"; +static const char __pyx_k_mask[] = "mask"; +static const char __pyx_k_mpfr[] = "mpfr"; +static const char __pyx_k_name[] = "__name__"; +static const char __pyx_k_prec[] = "prec"; +static const char __pyx_k_rnd1[] = "rnd1"; +static const char __pyx_k_rnd2[] = "rnd2"; +static const char __pyx_k_self[] = "self"; +static const char __pyx_k_sign[] = "sign"; +static const char __pyx_k_spec[] = "__spec__"; +static const char __pyx_k_test[] = "__test__"; +static const char __pyx_k_warn[] = "warn"; +static const char __pyx_k_Mpz_t[] = "Mpz_t"; +static const char __pyx_k_ascii[] = "ascii"; +static const char __pyx_k_flags[] = "flags"; +static const char __pyx_k_major[] = "major"; +static const char __pyx_k_minor[] = "minor"; +static const char __pyx_k_range[] = "range"; +static const char __pyx_k_signp[] = "signp"; +static const char __pyx_k_split[] = "split"; +static const char __pyx_k_Mpfr_t[] = "Mpfr_t"; +static const char __pyx_k_digits[] = "digits"; +static const char __pyx_k_enable[] = "enable"; +static const char __pyx_k_encode[] = "encode"; +static const char __pyx_k_endptr[] = "endptr"; +static const char __pyx_k_format[] = "format"; +static const char __pyx_k_import[] = "__import__"; +static const char __pyx_k_output[] = "output"; +static const char __pyx_k_reduce[] = "__reduce__"; +static const char __pyx_k_bytes_s[] = "bytes_s"; +static const char __pyx_k_disable[] = "disable"; +static const char __pyx_k_mpfr_ai[] = "mpfr_ai"; +static const char __pyx_k_mpfr_j0[] = "mpfr_j0"; +static const char __pyx_k_mpfr_j1[] = "mpfr_j1"; +static const char __pyx_k_mpfr_jn[] = "mpfr_jn"; +static const char __pyx_k_mpfr_y0[] = "mpfr_y0"; +static const char __pyx_k_mpfr_y1[] = "mpfr_y1"; +static const char __pyx_k_mpfr_yn[] = "mpfr_yn"; +static const char __pyx_k_patches[] = "patches"; +static const char __pyx_k_ternary[] = "ternary"; +static const char __pyx_k_version[] = "version"; +static const char __pyx_k_LONG_MAX[] = "_LONG_MAX"; +static const char __pyx_k_LONG_MIN[] = "_LONG_MIN"; +static const char __pyx_k_c_digits[] = "c_digits"; +static const char __pyx_k_category[] = "category"; +static const char __pyx_k_endindex[] = "endindex"; +static const char __pyx_k_exponent[] = "exponent"; +static const char __pyx_k_freefunc[] = "freefunc"; +static const char __pyx_k_getstate[] = "__getstate__"; +static const char __pyx_k_mpfr_abs[] = "mpfr_abs"; +static const char __pyx_k_mpfr_add[] = "mpfr_add"; +static const char __pyx_k_mpfr_agm[] = "mpfr_agm"; +static const char __pyx_k_mpfr_cmp[] = "mpfr_cmp"; +static const char __pyx_k_mpfr_cos[] = "mpfr_cos"; +static const char __pyx_k_mpfr_cot[] = "mpfr_cot"; +static const char __pyx_k_mpfr_csc[] = "mpfr_csc"; +static const char __pyx_k_mpfr_dim[] = "mpfr_dim"; +static const char __pyx_k_mpfr_div[] = "mpfr_div"; +static const char __pyx_k_mpfr_erf[] = "mpfr_erf"; +static const char __pyx_k_mpfr_exp[] = "mpfr_exp"; +static const char __pyx_k_mpfr_fma[] = "mpfr_fma"; +static const char __pyx_k_mpfr_fms[] = "mpfr_fms"; +static const char __pyx_k_mpfr_li2[] = "mpfr_li2"; +static const char __pyx_k_mpfr_log[] = "mpfr_log"; +static const char __pyx_k_mpfr_max[] = "mpfr_max"; +static const char __pyx_k_mpfr_min[] = "mpfr_min"; +static const char __pyx_k_mpfr_mul[] = "mpfr_mul"; +static const char __pyx_k_mpfr_neg[] = "mpfr_neg"; +static const char __pyx_k_mpfr_pow[] = "mpfr_pow"; +static const char __pyx_k_mpfr_pyx[] = "mpfr.pyx"; +static const char __pyx_k_mpfr_sec[] = "mpfr_sec"; +static const char __pyx_k_mpfr_set[] = "mpfr_set"; +static const char __pyx_k_mpfr_sgn[] = "mpfr_sgn"; +static const char __pyx_k_mpfr_sin[] = "mpfr_sin"; +static const char __pyx_k_mpfr_sqr[] = "mpfr_sqr"; +static const char __pyx_k_mpfr_sub[] = "mpfr_sub"; +static const char __pyx_k_mpfr_sum[] = "mpfr_sum"; +static const char __pyx_k_mpfr_tan[] = "mpfr_tan"; +static const char __pyx_k_pointers[] = "pointers"; +static const char __pyx_k_quotient[] = "quotient"; +static const char __pyx_k_setstate[] = "__setstate__"; +static const char __pyx_k_startptr[] = "startptr"; +static const char __pyx_k_template[] = "template"; +static const char __pyx_k_warnings[] = "warnings"; +static const char __pyx_k_MPFR_RNDA[] = "MPFR_RNDA"; +static const char __pyx_k_MPFR_RNDD[] = "MPFR_RNDD"; +static const char __pyx_k_MPFR_RNDF[] = "MPFR_RNDF"; +static const char __pyx_k_MPFR_RNDN[] = "MPFR_RNDN"; +static const char __pyx_k_MPFR_RNDU[] = "MPFR_RNDU"; +static const char __pyx_k_MPFR_RNDZ[] = "MPFR_RNDZ"; +static const char __pyx_k_TypeError[] = "TypeError"; +static const char __pyx_k_ULONG_MAX[] = "_ULONG_MAX"; +static const char __pyx_k_isenabled[] = "isenabled"; +static const char __pyx_k_mpfr_acos[] = "mpfr_acos"; +static const char __pyx_k_mpfr_asin[] = "mpfr_asin"; +static const char __pyx_k_mpfr_atan[] = "mpfr_atan"; +static const char __pyx_k_mpfr_beta[] = "mpfr_beta"; +static const char __pyx_k_mpfr_cbrt[] = "mpfr_cbrt"; +static const char __pyx_k_mpfr_ceil[] = "mpfr_ceil"; +static const char __pyx_k_mpfr_cosh[] = "mpfr_cosh"; +static const char __pyx_k_mpfr_coth[] = "mpfr_coth"; +static const char __pyx_k_mpfr_csch[] = "mpfr_csch"; +static const char __pyx_k_mpfr_eint[] = "mpfr_eint"; +static const char __pyx_k_mpfr_erfc[] = "mpfr_erfc"; +static const char __pyx_k_mpfr_exp2[] = "mpfr_exp2"; +static const char __pyx_k_mpfr_fmma[] = "mpfr_fmma"; +static const char __pyx_k_mpfr_fmms[] = "mpfr_fmms"; +static const char __pyx_k_mpfr_fmod[] = "mpfr_fmod"; +static const char __pyx_k_mpfr_frac[] = "mpfr_frac"; +static const char __pyx_k_mpfr_init[] = "mpfr_init"; +static const char __pyx_k_mpfr_log2[] = "mpfr_log2"; +static const char __pyx_k_mpfr_modf[] = "mpfr_modf"; +static const char __pyx_k_mpfr_rint[] = "mpfr_rint"; +static const char __pyx_k_mpfr_root[] = "mpfr_root"; +static const char __pyx_k_mpfr_sech[] = "mpfr_sech"; +static const char __pyx_k_mpfr_sinh[] = "mpfr_sinh"; +static const char __pyx_k_mpfr_sqrt[] = "mpfr_sqrt"; +static const char __pyx_k_mpfr_swap[] = "mpfr_swap"; +static const char __pyx_k_mpfr_tanh[] = "mpfr_tanh"; +static const char __pyx_k_mpfr_zeta[] = "mpfr_zeta"; +static const char __pyx_k_pyx_state[] = "__pyx_state"; +static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; +static const char __pyx_k_ValueError[] = "ValueError"; +static const char __pyx_k_error_code[] = "error_code"; +static const char __pyx_k_mpfr_acosh[] = "mpfr_acosh"; +static const char __pyx_k_mpfr_asinh[] = "mpfr_asinh"; +static const char __pyx_k_mpfr_atan2[] = "mpfr_atan2"; +static const char __pyx_k_mpfr_atanh[] = "mpfr_atanh"; +static const char __pyx_k_mpfr_clear[] = "mpfr_clear"; +static const char __pyx_k_mpfr_exp10[] = "mpfr_exp10"; +static const char __pyx_k_mpfr_expm1[] = "mpfr_expm1"; +static const char __pyx_k_mpfr_floor[] = "mpfr_floor"; +static const char __pyx_k_mpfr_frexp[] = "mpfr_frexp"; +static const char __pyx_k_mpfr_gamma[] = "mpfr_gamma"; +static const char __pyx_k_mpfr_get_d[] = "mpfr_get_d"; +static const char __pyx_k_mpfr_get_z[] = "mpfr_get_z"; +static const char __pyx_k_mpfr_hypot[] = "mpfr_hypot"; +static const char __pyx_k_mpfr_inf_p[] = "mpfr_inf_p"; +static const char __pyx_k_mpfr_init2[] = "mpfr_init2"; +static const char __pyx_k_mpfr_inits[] = "mpfr_inits"; +static const char __pyx_k_mpfr_log10[] = "mpfr_log10"; +static const char __pyx_k_mpfr_log1p[] = "mpfr_log1p"; +static const char __pyx_k_mpfr_nan_p[] = "mpfr_nan_p"; +static const char __pyx_k_mpfr_round[] = "mpfr_round"; +static const char __pyx_k_mpfr_set_d[] = "mpfr_set_d"; +static const char __pyx_k_mpfr_set_z[] = "mpfr_set_z"; +static const char __pyx_k_mpfr_trunc[] = "mpfr_trunc"; +static const char __pyx_k_patchlevel[] = "patchlevel"; +static const char __pyx_k_thresholds[] = "thresholds"; +static const char __pyx_k_MemoryError[] = "MemoryError"; +static const char __pyx_k_mpfr_clears[] = "mpfr_clears"; +static const char __pyx_k_mpfr_cmpabs[] = "mpfr_cmpabs"; +static const char __pyx_k_mpfr_fac_ui[] = "mpfr_fac_ui"; +static const char __pyx_k_mpfr_get_si[] = "mpfr_get_si"; +static const char __pyx_k_mpfr_get_ui[] = "mpfr_get_ui"; +static const char __pyx_k_mpfr_inits2[] = "mpfr_inits2"; +static const char __pyx_k_mpfr_less_p[] = "mpfr_less_p"; +static const char __pyx_k_mpfr_lgamma[] = "mpfr_lgamma"; +static const char __pyx_k_mpfr_log_ui[] = "mpfr_log_ui"; +static const char __pyx_k_mpfr_remquo[] = "mpfr_remquo"; +static const char __pyx_k_mpfr_set_si[] = "mpfr_set_si"; +static const char __pyx_k_mpfr_set_ui[] = "mpfr_set_ui"; +static const char __pyx_k_mpfr_zero_p[] = "mpfr_zero_p"; +static const char __pyx_k_mpz_get_str[] = "mpz_get_str"; +static const char __pyx_k_mpz_set_str[] = "mpz_set_str"; +static const char __pyx_k_MPFR_VERSION[] = "MPFR_VERSION"; +static const char __pyx_k_RuntimeError[] = "RuntimeError"; +static const char __pyx_k_c_digits_len[] = "c_digits_len"; +static const char __pyx_k_initializing[] = "_initializing"; +static const char __pyx_k_is_coroutine[] = "_is_coroutine"; +static const char __pyx_k_mpfr_digamma[] = "mpfr_digamma"; +static const char __pyx_k_mpfr_equal_p[] = "mpfr_equal_p"; +static const char __pyx_k_mpfr_fmodquo[] = "mpfr_fmodquo"; +static const char __pyx_k_mpfr_get_exp[] = "mpfr_get_exp"; +static const char __pyx_k_mpfr_get_str[] = "mpfr_get_str"; +static const char __pyx_k_mpfr_lngamma[] = "mpfr_lngamma"; +static const char __pyx_k_mpfr_set_exp[] = "mpfr_set_exp"; +static const char __pyx_k_mpfr_set_inf[] = "mpfr_set_inf"; +static const char __pyx_k_mpfr_set_nan[] = "mpfr_set_nan"; +static const char __pyx_k_mpfr_set_str[] = "mpfr_set_str"; +static const char __pyx_k_mpfr_setsign[] = "mpfr_setsign"; +static const char __pyx_k_mpfr_signbit[] = "mpfr_signbit"; +static const char __pyx_k_mpfr_sin_cos[] = "mpfr_sin_cos"; +static const char __pyx_k_mpfr_strtofr[] = "mpfr_strtofr"; +static const char __pyx_k_mpfr_zeta_ui[] = "mpfr_zeta_ui"; +static const char __pyx_k_stringsource[] = ""; +static const char __pyx_k_ternary_pair[] = "ternary_pair"; +static const char __pyx_k_version_info[] = "version_info"; +static const char __pyx_k_MPFR_PREC_MAX[] = "MPFR_PREC_MAX"; +static const char __pyx_k_MPFR_PREC_MIN[] = "MPFR_PREC_MIN"; +static const char __pyx_k_mpfr_asprintf[] = "mpfr_asprintf"; +static const char __pyx_k_mpfr_const_pi[] = "mpfr_const_pi"; +static const char __pyx_k_mpfr_copysign[] = "mpfr_copysign"; +static const char __pyx_k_mpfr_divby0_p[] = "mpfr_divby0_p"; +static const char __pyx_k_mpfr_get_emax[] = "mpfr_get_emax"; +static const char __pyx_k_mpfr_get_emin[] = "mpfr_get_emin"; +static const char __pyx_k_mpfr_get_prec[] = "mpfr_get_prec"; +static const char __pyx_k_mpfr_min_prec[] = "mpfr_min_prec"; +static const char __pyx_k_mpfr_number_p[] = "mpfr_number_p"; +static const char __pyx_k_mpfr_rec_sqrt[] = "mpfr_rec_sqrt"; +static const char __pyx_k_mpfr_rootn_ui[] = "mpfr_rootn_ui"; +static const char __pyx_k_mpfr_set_emax[] = "mpfr_set_emax"; +static const char __pyx_k_mpfr_set_emin[] = "mpfr_set_emin"; +static const char __pyx_k_mpfr_set_prec[] = "mpfr_set_prec"; +static const char __pyx_k_mpfr_set_zero[] = "mpfr_set_zero"; +static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; +static const char __pyx_k_rounding_mode[] = "rounding_mode"; +static const char __pyx_k_MPFR_FLAGS_ALL[] = "MPFR_FLAGS_ALL"; +static const char __pyx_k_MPFR_FLAGS_NAN[] = "MPFR_FLAGS_NAN"; +static const char __pyx_k_c_digits_alloc[] = "c_digits_alloc"; +static const char __pyx_k_mpfr_can_round[] = "mpfr_can_round"; +static const char __pyx_k_mpfr_flags_set[] = "mpfr_flags_set"; +static const char __pyx_k_mpfr_free_pool[] = "mpfr_free_pool"; +static const char __pyx_k_mpfr_gamma_inc[] = "mpfr_gamma_inc"; +static const char __pyx_k_mpfr_greater_p[] = "mpfr_greater_p"; +static const char __pyx_k_mpfr_integer_p[] = "mpfr_integer_p"; +static const char __pyx_k_mpfr_nanflag_p[] = "mpfr_nanflag_p"; +static const char __pyx_k_mpfr_nextabove[] = "mpfr_nextabove"; +static const char __pyx_k_mpfr_nextbelow[] = "mpfr_nextbelow"; +static const char __pyx_k_mpfr_regular_p[] = "mpfr_regular_p"; +static const char __pyx_k_mpfr_remainder[] = "mpfr_remainder"; +static const char __pyx_k_mpfr_rint_ceil[] = "mpfr_rint_ceil"; +static const char __pyx_k_mpfr_roundeven[] = "mpfr_roundeven"; +static const char __pyx_k_mpfr_sinh_cosh[] = "mpfr_sinh_cosh"; +static const char __pyx_k_template_bytes[] = "template_bytes"; +static const char __pyx_k_mpfr_const_log2[] = "mpfr_const_log2"; +static const char __pyx_k_mpfr_flags_save[] = "mpfr_flags_save"; +static const char __pyx_k_mpfr_flags_test[] = "mpfr_flags_test"; +static const char __pyx_k_mpfr_free_cache[] = "mpfr_free_cache"; +static const char __pyx_k_mpfr_get_d_2exp[] = "mpfr_get_d_2exp"; +static const char __pyx_k_mpfr_get_z_2exp[] = "mpfr_get_z_2exp"; +static const char __pyx_k_mpfr_inexflag_p[] = "mpfr_inexflag_p"; +static const char __pyx_k_mpfr_nexttoward[] = "mpfr_nexttoward"; +static const char __pyx_k_mpfr_overflow_p[] = "mpfr_overflow_p"; +static const char __pyx_k_mpfr_prec_round[] = "mpfr_prec_round"; +static const char __pyx_k_mpfr_rint_floor[] = "mpfr_rint_floor"; +static const char __pyx_k_mpfr_rint_round[] = "mpfr_rint_round"; +static const char __pyx_k_mpfr_rint_trunc[] = "mpfr_rint_trunc"; +static const char __pyx_k_mpfr_set_divby0[] = "mpfr_set_divby0"; +static const char __pyx_k_mpfr_set_z_2exp[] = "mpfr_set_z_2exp"; +static const char __pyx_k_output_as_bytes[] = "output_as_bytes"; +static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; +static const char __pyx_k_MPFR_VERSION_NUM[] = "MPFR_VERSION_NUM"; +static const char __pyx_k_mpfr_check_range[] = "mpfr_check_range"; +static const char __pyx_k_mpfr_clear_flags[] = "mpfr_clear_flags"; +static const char __pyx_k_mpfr_const_euler[] = "mpfr_const_euler"; +static const char __pyx_k_mpfr_flags_clear[] = "mpfr_flags_clear"; +static const char __pyx_k_mpfr_free_cache2[] = "mpfr_free_cache2"; +static const char __pyx_k_mpfr_get_patches[] = "mpfr_get_patches"; +static const char __pyx_k_mpfr_get_version[] = "mpfr_get_version"; +static const char __pyx_k_mpfr_lessequal_p[] = "mpfr_lessequal_p"; +static const char __pyx_k_mpfr_set_nanflag[] = "mpfr_set_nanflag"; +static const char __pyx_k_mpfr_set_si_2exp[] = "mpfr_set_si_2exp"; +static const char __pyx_k_mpfr_set_ui_2exp[] = "mpfr_set_ui_2exp"; +static const char __pyx_k_mpfr_underflow_p[] = "mpfr_underflow_p"; +static const char __pyx_k_mpfr_unordered_p[] = "mpfr_unordered_p"; +static const char __pyx_k_MPFR_EMAX_DEFAULT[] = "MPFR_EMAX_DEFAULT"; +static const char __pyx_k_MPFR_EMIN_DEFAULT[] = "MPFR_EMIN_DEFAULT"; +static const char __pyx_k_MPFR_FLAGS_DIVBY0[] = "MPFR_FLAGS_DIVBY0"; +static const char __pyx_k_MPFR_FLAGS_ERANGE[] = "MPFR_FLAGS_ERANGE"; +static const char __pyx_k_invalid_flag_mask[] = "invalid flag mask {}"; +static const char __pyx_k_mpfr_clear_divby0[] = "mpfr_clear_divby0"; +static const char __pyx_k_mpfr_erangeflag_p[] = "mpfr_erangeflag_p"; +static const char __pyx_k_mpfr_fits_slong_p[] = "mpfr_fits_slong_p"; +static const char __pyx_k_mpfr_fits_ulong_p[] = "mpfr_fits_ulong_p"; +static const char __pyx_k_mpfr_get_emax_max[] = "mpfr_get_emax_max"; +static const char __pyx_k_mpfr_get_emax_min[] = "mpfr_get_emax_min"; +static const char __pyx_k_mpfr_get_emin_max[] = "mpfr_get_emin_max"; +static const char __pyx_k_mpfr_get_emin_min[] = "mpfr_get_emin_min"; +static const char __pyx_k_mpfr_root_no_warn[] = "_mpfr_root_no_warn"; +static const char __pyx_k_mpfr_set_inexflag[] = "mpfr_set_inexflag"; +static const char __pyx_k_mpfr_set_overflow[] = "mpfr_set_overflow"; +static const char __pyx_k_mpfr_subnormalize[] = "mpfr_subnormalize"; +static const char __pyx_k_DeprecationWarning[] = "DeprecationWarning"; +static const char __pyx_k_MPFR_FLAGS_INEXACT[] = "MPFR_FLAGS_INEXACT"; +static const char __pyx_k_MPFR_VERSION_MAJOR[] = "MPFR_VERSION_MAJOR"; +static const char __pyx_k_MPFR_VERSION_MINOR[] = "MPFR_VERSION_MINOR"; +static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; +static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; +static const char __pyx_k_mpfr_clear_nanflag[] = "mpfr_clear_nanflag"; +static const char __pyx_k_mpfr_const_catalan[] = "mpfr_const_catalan"; +static const char __pyx_k_mpfr_flags_restore[] = "mpfr_flags_restore"; +static const char __pyx_k_mpfr_initialized_p[] = "mpfr_initialized_p"; +static const char __pyx_k_mpfr_lessgreater_p[] = "mpfr_lessgreater_p"; +static const char __pyx_k_mpfr_set_underflow[] = "mpfr_set_underflow"; +static const char __pyx_k_MPFR_FLAGS_OVERFLOW[] = "MPFR_FLAGS_OVERFLOW"; +static const char __pyx_k_MPFR_VERSION_STRING[] = "MPFR_VERSION_STRING"; +static const char __pyx_k_mpfr_buildopt_tls_p[] = "mpfr_buildopt_tls_p"; +static const char __pyx_k_mpfr_clear_inexflag[] = "mpfr_clear_inexflag"; +static const char __pyx_k_mpfr_clear_overflow[] = "mpfr_clear_overflow"; +static const char __pyx_k_mpfr_greaterequal_p[] = "mpfr_greaterequal_p"; +static const char __pyx_k_mpfr_print_rnd_mode[] = "mpfr_print_rnd_mode"; +static const char __pyx_k_mpfr_rint_roundeven[] = "mpfr_rint_roundeven"; +static const char __pyx_k_mpfr_set_erangeflag[] = "mpfr_set_erangeflag"; +static const char __pyx_k_MPFR_FLAGS_UNDERFLOW[] = "MPFR_FLAGS_UNDERFLOW"; +static const char __pyx_k_mpfr_clear_underflow[] = "mpfr_clear_underflow"; +static const char __pyx_k_MPFR_FREE_LOCAL_CACHE[] = "MPFR_FREE_LOCAL_CACHE"; +static const char __pyx_k_Mpz_t___reduce_cython[] = "Mpz_t.__reduce_cython__"; +static const char __pyx_k_invalid_rounding_mode[] = "invalid rounding mode {}"; +static const char __pyx_k_mpfr_clear_erangeflag[] = "mpfr_clear_erangeflag"; +static const char __pyx_k_mpfr_get_default_prec[] = "mpfr_get_default_prec"; +static const char __pyx_k_mpfr_set_default_prec[] = "mpfr_set_default_prec"; +static const char __pyx_k_MPFR_FREE_GLOBAL_CACHE[] = "MPFR_FREE_GLOBAL_CACHE"; +static const char __pyx_k_Mpfr_t___reduce_cython[] = "Mpfr_t.__reduce_cython__"; +static const char __pyx_k_mpfr_mp_memory_cleanup[] = "mpfr_mp_memory_cleanup"; +static const char __pyx_k_MPFR_VERSION_PATCHLEVEL[] = "MPFR_VERSION_PATCHLEVEL"; +static const char __pyx_k_Mpz_t___setstate_cython[] = "Mpz_t.__setstate_cython__"; +static const char __pyx_k_mpfr_buildopt_decimal_p[] = "mpfr_buildopt_decimal_p"; +static const char __pyx_k_mpfr_buildopt_tune_case[] = "mpfr_buildopt_tune_case"; +static const char __pyx_k_Mpfr_t___setstate_cython[] = "Mpfr_t.__setstate_cython__"; +static const char __pyx_k_mpfr_buildopt_float128_p[] = "mpfr_buildopt_float128_p"; +static const char __pyx_k_Not_a_valid_number_for_base[] = "Not a valid number for base {}: {}"; +static const char __pyx_k_mpfr_buildopt_sharedcache_p[] = "mpfr_buildopt_sharedcache_p"; +static const char __pyx_k_mpfr_buildopt_gmpinternals_p[] = "mpfr_buildopt_gmpinternals_p"; +static const char __pyx_k_Error_during_string_conversion[] = "Error during string conversion."; +static const char __pyx_k_mpfr_get_default_rounding_mode[] = "mpfr_get_default_rounding_mode"; +static const char __pyx_k_mpfr_set_default_rounding_mode[] = "mpfr_set_default_rounding_mode"; +static const char __pyx_k_mpfr_mp_memory_cleanup_returned[] = "mpfr_mp_memory_cleanup returned nonzero value {}"; +static const char __pyx_k_precision_should_be_between_and[] = "precision should be between {} and {}"; +static const char __pyx_k_self__value_cannot_be_converted[] = "self._value cannot be converted to a Python object for pickling"; +static const char __pyx_k_Base_must_satisfy_2_base_62_or_2[] = "Base must satisfy 2 <= base <= 62 or -2 >= base >= -36."; +static const char __pyx_k_Cannot_convert_None_to_mpfr_Mpfr[] = "Cannot convert None to mpfr.Mpfr_t"; +static const char __pyx_k_Mpfr_t_instance_is_already_initi[] = "Mpfr_t instance {} is already initialized."; +static const char __pyx_k_Mpfr_t_instance_should_be_initia[] = "Mpfr_t instance {} should be initialized before use"; +static const char __pyx_k_base_must_satisfy_2_base_62_or_b[] = "base must satisfy 2 <= base <= 62 or base == 0"; +static const char __pyx_k_base_should_be_in_the_range_2_to[] = "base should be in the range 2 to 62 (inclusive)"; +static const char __pyx_k_base_should_be_zero_or_in_the_ra[] = "base should be zero or in the range 2 to 62 (inclusive)"; +static const char __pyx_k_exponent_not_in_current_exponent[] = "exponent not in current exponent range"; +static const char __pyx_k_flag_mask_contains_invalid_flags[] = "flag mask {} contains invalid flags"; +static const char __pyx_k_mpfr_root_is_deprecated_Use_mpfr[] = "mpfr_root is deprecated. Use mpfr_rootn_ui instead."; +static const char __pyx_k_n_should_be_either_0_or_at_least[] = "n should be either 0 or at least 2"; +static const char __pyx_k_new_exponent_for_emin_is_outside[] = "new exponent for emin is outside allowable range"; +static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; +/* #### Code section: decls ### */ +static int __pyx_pf_4mpfr_5Mpz_t___cinit__(struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_self); /* proto */ +static void __pyx_pf_4mpfr_5Mpz_t_2__dealloc__(struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_5Mpz_t_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_5Mpz_t_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_4mpfr_mpz_set_str(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_rop, PyObject *__pyx_v_s, int __pyx_v_base); /* proto */ +static PyObject *__pyx_pf_4mpfr_2mpz_get_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_base, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_op); /* proto */ +static void __pyx_pf_4mpfr_6Mpfr_t___dealloc__(struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_6Mpfr_t_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_6Mpfr_t_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_4mpfr_4mpfr_initialized_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_6mpfr_init2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_prec_t __pyx_v_prec); /* proto */ +static PyObject *__pyx_pf_4mpfr_8mpfr_inits2(CYTHON_UNUSED PyObject *__pyx_self, mpfr_prec_t __pyx_v_prec, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_4mpfr_10mpfr_clear(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_4mpfr_12mpfr_clears(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_4mpfr_14mpfr_init(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_4mpfr_16mpfr_inits(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */ +static PyObject *__pyx_pf_4mpfr_18mpfr_set_default_prec(CYTHON_UNUSED PyObject *__pyx_self, mpfr_prec_t __pyx_v_prec); /* proto */ +static PyObject *__pyx_pf_4mpfr_20mpfr_get_default_prec(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_22mpfr_set_prec(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_prec_t __pyx_v_prec); /* proto */ +static PyObject *__pyx_pf_4mpfr_24mpfr_get_prec(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_4mpfr_26mpfr_set(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_28mpfr_set_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, unsigned long __pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_30mpfr_set_si(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, long __pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_32mpfr_set_d(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, double __pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_34mpfr_set_z(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_36mpfr_set_ui_2exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, unsigned long __pyx_v_op, mpfr_exp_t __pyx_v_e, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_38mpfr_set_si_2exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, long __pyx_v_op, mpfr_exp_t __pyx_v_e, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_40mpfr_set_z_2exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_op, mpfr_exp_t __pyx_v_e, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_42mpfr_set_str(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, PyObject *__pyx_v_s, int __pyx_v_base, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_44mpfr_strtofr(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, PyObject *__pyx_v_s, int __pyx_v_base, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_46mpfr_set_nan(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_48mpfr_set_inf(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, int __pyx_v_sign); /* proto */ +static PyObject *__pyx_pf_4mpfr_50mpfr_set_zero(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, int __pyx_v_sign); /* proto */ +static PyObject *__pyx_pf_4mpfr_52mpfr_swap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y); /* proto */ +static PyObject *__pyx_pf_4mpfr_54mpfr_get_d(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_56mpfr_get_si(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_58mpfr_get_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_60mpfr_get_d_2exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_62mpfr_frexp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_64mpfr_get_z_2exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_66mpfr_get_z(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_68mpfr_get_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_b, size_t __pyx_v_n, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_70mpfr_fits_ulong_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_72mpfr_fits_slong_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_74mpfr_add(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_76mpfr_sub(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_78mpfr_mul(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_80mpfr_sqr(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_82mpfr_div(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_84mpfr_sqrt(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_86mpfr_rec_sqrt(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_88mpfr_cbrt(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_90mpfr_rootn_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, unsigned long __pyx_v_k, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_92mpfr_root(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, unsigned long __pyx_v_k, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_94_mpfr_root_no_warn(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, unsigned long __pyx_v_k, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_96mpfr_pow(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_98mpfr_neg(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_100mpfr_abs(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_102mpfr_dim(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_104mpfr_cmp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2); /* proto */ +static PyObject *__pyx_pf_4mpfr_106mpfr_cmpabs(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2); /* proto */ +static PyObject *__pyx_pf_4mpfr_108mpfr_nan_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_110mpfr_inf_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_112mpfr_number_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_114mpfr_zero_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_116mpfr_regular_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_118mpfr_sgn(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_120mpfr_greater_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2); /* proto */ +static PyObject *__pyx_pf_4mpfr_122mpfr_greaterequal_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2); /* proto */ +static PyObject *__pyx_pf_4mpfr_124mpfr_less_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2); /* proto */ +static PyObject *__pyx_pf_4mpfr_126mpfr_lessequal_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2); /* proto */ +static PyObject *__pyx_pf_4mpfr_128mpfr_equal_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2); /* proto */ +static PyObject *__pyx_pf_4mpfr_130mpfr_lessgreater_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2); /* proto */ +static PyObject *__pyx_pf_4mpfr_132mpfr_unordered_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2); /* proto */ +static PyObject *__pyx_pf_4mpfr_134mpfr_log(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_136mpfr_log_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, unsigned long __pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_138mpfr_log2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_140mpfr_log10(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_142mpfr_log1p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_144mpfr_exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_146mpfr_exp2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_148mpfr_exp10(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_150mpfr_expm1(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_152mpfr_cos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_154mpfr_sin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_156mpfr_tan(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_158mpfr_sin_cos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_sop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_cop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_160mpfr_sec(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_162mpfr_csc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_164mpfr_cot(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_166mpfr_acos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_168mpfr_asin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_170mpfr_atan(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_172mpfr_atan2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_174mpfr_cosh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_176mpfr_sinh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_178mpfr_tanh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_180mpfr_sinh_cosh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_sop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_cop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_182mpfr_sech(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_184mpfr_csch(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_186mpfr_coth(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_188mpfr_acosh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_190mpfr_asinh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_192mpfr_atanh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_194mpfr_fac_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, unsigned long __pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_196mpfr_eint(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_198mpfr_li2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_200mpfr_gamma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_202mpfr_gamma_inc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_204mpfr_lngamma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_206mpfr_lgamma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_208mpfr_digamma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_210mpfr_beta(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_212mpfr_zeta(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_214mpfr_zeta_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, unsigned long __pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_216mpfr_erf(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_218mpfr_erfc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_220mpfr_j0(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_222mpfr_j1(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_224mpfr_jn(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, long __pyx_v_n, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_226mpfr_y0(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_228mpfr_y1(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_230mpfr_yn(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, long __pyx_v_n, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_232mpfr_fma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_234mpfr_fms(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_236mpfr_fmma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op4, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_238mpfr_fmms(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op4, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_240mpfr_agm(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_242mpfr_hypot(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_244mpfr_ai(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_246mpfr_const_log2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_248mpfr_const_pi(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_250mpfr_const_euler(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_252mpfr_const_catalan(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_254mpfr_free_cache(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_256mpfr_free_cache2(CYTHON_UNUSED PyObject *__pyx_self, mpfr_free_cache_t __pyx_v_way); /* proto */ +static PyObject *__pyx_pf_4mpfr_258mpfr_free_pool(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_260mpfr_mp_memory_cleanup(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_262mpfr_sum(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, PyObject *__pyx_v_tab, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_264mpfr_asprintf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_template, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_266mpfr_rint(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_268mpfr_ceil(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_270mpfr_floor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_272mpfr_round(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_274mpfr_roundeven(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_276mpfr_trunc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_278mpfr_rint_ceil(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_280mpfr_rint_floor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_282mpfr_rint_round(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_284mpfr_rint_roundeven(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_286mpfr_rint_trunc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_288mpfr_frac(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_290mpfr_modf(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_iop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_fop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_292mpfr_fmod(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_294mpfr_fmodquo(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_296mpfr_remainder(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_298mpfr_remquo(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_300mpfr_integer_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_302mpfr_set_default_rounding_mode(CYTHON_UNUSED PyObject *__pyx_self, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_304mpfr_get_default_rounding_mode(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_306mpfr_prec_round(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_prec_t __pyx_v_prec, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_308mpfr_can_round(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_b, mpfr_exp_t __pyx_v_err, mpfr_rnd_t __pyx_v_rnd1, mpfr_rnd_t __pyx_v_rnd2, mpfr_prec_t __pyx_v_prec); /* proto */ +static PyObject *__pyx_pf_4mpfr_310mpfr_min_prec(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_4mpfr_312mpfr_print_rnd_mode(CYTHON_UNUSED PyObject *__pyx_self, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_314mpfr_nexttoward(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y); /* proto */ +static PyObject *__pyx_pf_4mpfr_316mpfr_nextabove(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_318mpfr_nextbelow(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_320mpfr_min(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_322mpfr_max(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_324mpfr_get_exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_326mpfr_set_exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_exp_t __pyx_v_exp); /* proto */ +static PyObject *__pyx_pf_4mpfr_328mpfr_signbit(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op); /* proto */ +static PyObject *__pyx_pf_4mpfr_330mpfr_setsign(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, PyObject *__pyx_v_s, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_332mpfr_copysign(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_334mpfr_get_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_336MPFR_VERSION_NUM(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_major, int __pyx_v_minor, int __pyx_v_patchlevel); /* proto */ +static PyObject *__pyx_pf_4mpfr_338mpfr_get_patches(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_340mpfr_buildopt_tls_p(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_342mpfr_buildopt_float128_p(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_344mpfr_buildopt_decimal_p(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_346mpfr_buildopt_gmpinternals_p(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_348mpfr_buildopt_sharedcache_p(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_350mpfr_buildopt_tune_case(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_352mpfr_get_emin(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_354mpfr_get_emax(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_356mpfr_set_emin(CYTHON_UNUSED PyObject *__pyx_self, mpfr_exp_t __pyx_v_exp); /* proto */ +static PyObject *__pyx_pf_4mpfr_358mpfr_set_emax(CYTHON_UNUSED PyObject *__pyx_self, mpfr_exp_t __pyx_v_exp); /* proto */ +static PyObject *__pyx_pf_4mpfr_360mpfr_get_emin_min(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_362mpfr_get_emin_max(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_364mpfr_get_emax_min(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_366mpfr_get_emax_max(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_368mpfr_check_range(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, int __pyx_v_t, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_370mpfr_subnormalize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, int __pyx_v_t, mpfr_rnd_t __pyx_v_rnd); /* proto */ +static PyObject *__pyx_pf_4mpfr_372mpfr_clear_underflow(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_374mpfr_clear_overflow(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_376mpfr_clear_divby0(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_378mpfr_clear_nanflag(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_380mpfr_clear_inexflag(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_382mpfr_clear_erangeflag(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_384mpfr_set_underflow(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_386mpfr_set_overflow(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_388mpfr_set_divby0(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_390mpfr_set_nanflag(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_392mpfr_set_inexflag(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_394mpfr_set_erangeflag(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_396mpfr_clear_flags(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_398mpfr_underflow_p(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_400mpfr_overflow_p(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_402mpfr_divby0_p(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_404mpfr_nanflag_p(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_406mpfr_inexflag_p(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_408mpfr_erangeflag_p(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_410mpfr_flags_clear(CYTHON_UNUSED PyObject *__pyx_self, mpfr_flags_t __pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_4mpfr_412mpfr_flags_set(CYTHON_UNUSED PyObject *__pyx_self, mpfr_flags_t __pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_4mpfr_414mpfr_flags_test(CYTHON_UNUSED PyObject *__pyx_self, mpfr_flags_t __pyx_v_mask); /* proto */ +static PyObject *__pyx_pf_4mpfr_416mpfr_flags_save(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_4mpfr_418mpfr_flags_restore(CYTHON_UNUSED PyObject *__pyx_self, mpfr_flags_t __pyx_v_flags, mpfr_flags_t __pyx_v_mask); /* proto */ +static PyObject *__pyx_tp_new_4mpfr_Mpz_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_4mpfr_Mpfr_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static __Pyx_CachedCFunction __pyx_umethod_PyBytes_Type_split = {0, 0, 0, 0, 0}; +/* #### Code section: late_includes ### */ +/* #### Code section: module_state ### */ +typedef struct { + PyObject *__pyx_d; + PyObject *__pyx_b; + PyObject *__pyx_cython_runtime; + PyObject *__pyx_empty_tuple; + PyObject *__pyx_empty_bytes; + PyObject *__pyx_empty_unicode; + #ifdef __Pyx_CyFunction_USED + PyTypeObject *__pyx_CyFunctionType; + #endif + #ifdef __Pyx_FusedFunction_USED + PyTypeObject *__pyx_FusedFunctionType; + #endif + #ifdef __Pyx_Generator_USED + PyTypeObject *__pyx_GeneratorType; + #endif + #ifdef __Pyx_IterableCoroutine_USED + PyTypeObject *__pyx_IterableCoroutineType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineAwaitType; + #endif + #ifdef __Pyx_Coroutine_USED + PyTypeObject *__pyx_CoroutineType; + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + #endif + #if CYTHON_USE_MODULE_STATE + PyObject *__pyx_type_4mpfr_Mpz_t; + PyObject *__pyx_type_4mpfr_Mpfr_t; + #endif + PyTypeObject *__pyx_ptype_4mpfr_Mpz_t; + PyTypeObject *__pyx_ptype_4mpfr_Mpfr_t; + PyObject *__pyx_kp_u_Base_must_satisfy_2_base_62_or_2; + PyObject *__pyx_kp_u_Cannot_convert_None_to_mpfr_Mpfr; + PyObject *__pyx_n_s_DeprecationWarning; + PyObject *__pyx_kp_u_Error_during_string_conversion; + PyObject *__pyx_n_s_LONG_MAX; + PyObject *__pyx_n_s_LONG_MIN; + PyObject *__pyx_n_s_MPFR_EMAX_DEFAULT; + PyObject *__pyx_n_s_MPFR_EMIN_DEFAULT; + PyObject *__pyx_n_s_MPFR_FLAGS_ALL; + PyObject *__pyx_n_s_MPFR_FLAGS_DIVBY0; + PyObject *__pyx_n_s_MPFR_FLAGS_ERANGE; + PyObject *__pyx_n_s_MPFR_FLAGS_INEXACT; + PyObject *__pyx_n_s_MPFR_FLAGS_NAN; + PyObject *__pyx_n_s_MPFR_FLAGS_OVERFLOW; + PyObject *__pyx_n_s_MPFR_FLAGS_UNDERFLOW; + PyObject *__pyx_n_s_MPFR_FREE_GLOBAL_CACHE; + PyObject *__pyx_n_s_MPFR_FREE_LOCAL_CACHE; + PyObject *__pyx_n_s_MPFR_PREC_MAX; + PyObject *__pyx_n_s_MPFR_PREC_MIN; + PyObject *__pyx_n_s_MPFR_RNDA; + PyObject *__pyx_n_s_MPFR_RNDD; + PyObject *__pyx_n_s_MPFR_RNDF; + PyObject *__pyx_n_s_MPFR_RNDN; + PyObject *__pyx_n_s_MPFR_RNDU; + PyObject *__pyx_n_s_MPFR_RNDZ; + PyObject *__pyx_n_s_MPFR_VERSION; + PyObject *__pyx_n_s_MPFR_VERSION_MAJOR; + PyObject *__pyx_n_s_MPFR_VERSION_MINOR; + PyObject *__pyx_n_s_MPFR_VERSION_NUM; + PyObject *__pyx_n_s_MPFR_VERSION_PATCHLEVEL; + PyObject *__pyx_n_s_MPFR_VERSION_STRING; + PyObject *__pyx_n_s_MemoryError; + PyObject *__pyx_n_s_Mpfr_t; + PyObject *__pyx_n_s_Mpfr_t___reduce_cython; + PyObject *__pyx_n_s_Mpfr_t___setstate_cython; + PyObject *__pyx_kp_u_Mpfr_t_instance_is_already_initi; + PyObject *__pyx_kp_u_Mpfr_t_instance_should_be_initia; + PyObject *__pyx_n_s_Mpz_t; + PyObject *__pyx_n_s_Mpz_t___reduce_cython; + PyObject *__pyx_n_s_Mpz_t___setstate_cython; + PyObject *__pyx_kp_u_Not_a_valid_number_for_base; + PyObject *__pyx_n_s_RuntimeError; + PyObject *__pyx_n_s_TypeError; + PyObject *__pyx_n_s_ULONG_MAX; + PyObject *__pyx_n_s_ValueError; + PyObject *__pyx_n_s__12; + PyObject *__pyx_n_s__283; + PyObject *__pyx_n_s_arg; + PyObject *__pyx_n_s_args; + PyObject *__pyx_n_u_ascii; + PyObject *__pyx_n_s_asyncio_coroutines; + PyObject *__pyx_n_s_b; + PyObject *__pyx_n_s_base; + PyObject *__pyx_kp_u_base_must_satisfy_2_base_62_or_b; + PyObject *__pyx_kp_u_base_should_be_in_the_range_2_to; + PyObject *__pyx_kp_u_base_should_be_zero_or_in_the_ra; + PyObject *__pyx_n_s_bytes_s; + PyObject *__pyx_n_s_c_digits; + PyObject *__pyx_n_s_c_digits_alloc; + PyObject *__pyx_n_s_c_digits_len; + PyObject *__pyx_n_s_category; + PyObject *__pyx_n_s_cline_in_traceback; + PyObject *__pyx_n_s_cop; + PyObject *__pyx_n_s_d; + PyObject *__pyx_n_s_digits; + PyObject *__pyx_kp_u_disable; + PyObject *__pyx_n_s_e; + PyObject *__pyx_n_s_elt; + PyObject *__pyx_kp_u_enable; + PyObject *__pyx_n_s_encode; + PyObject *__pyx_n_s_endindex; + PyObject *__pyx_n_s_endptr; + PyObject *__pyx_n_s_err; + PyObject *__pyx_n_s_error_code; + PyObject *__pyx_n_s_exp; + PyObject *__pyx_n_s_exponent; + PyObject *__pyx_kp_u_exponent_not_in_current_exponent; + PyObject *__pyx_kp_u_flag_mask_contains_invalid_flags; + PyObject *__pyx_n_s_flags; + PyObject *__pyx_n_s_fop; + PyObject *__pyx_n_s_format; + PyObject *__pyx_n_s_freefunc; + PyObject *__pyx_kp_u_gc; + PyObject *__pyx_n_s_getstate; + PyObject *__pyx_n_s_i; + PyObject *__pyx_n_s_import; + PyObject *__pyx_n_s_initializing; + PyObject *__pyx_kp_u_invalid_flag_mask; + PyObject *__pyx_kp_u_invalid_rounding_mode; + PyObject *__pyx_n_s_iop; + PyObject *__pyx_n_s_is_coroutine; + PyObject *__pyx_kp_u_isenabled; + PyObject *__pyx_n_s_k; + PyObject *__pyx_n_s_main; + PyObject *__pyx_n_s_major; + PyObject *__pyx_n_s_mask; + PyObject *__pyx_n_s_minor; + PyObject *__pyx_n_s_mpfr; + PyObject *__pyx_n_s_mpfr_abs; + PyObject *__pyx_n_s_mpfr_acos; + PyObject *__pyx_n_s_mpfr_acosh; + PyObject *__pyx_n_s_mpfr_add; + PyObject *__pyx_n_s_mpfr_agm; + PyObject *__pyx_n_s_mpfr_ai; + PyObject *__pyx_n_s_mpfr_asin; + PyObject *__pyx_n_s_mpfr_asinh; + PyObject *__pyx_n_s_mpfr_asprintf; + PyObject *__pyx_n_s_mpfr_atan; + PyObject *__pyx_n_s_mpfr_atan2; + PyObject *__pyx_n_s_mpfr_atanh; + PyObject *__pyx_n_s_mpfr_beta; + PyObject *__pyx_n_s_mpfr_buildopt_decimal_p; + PyObject *__pyx_n_s_mpfr_buildopt_float128_p; + PyObject *__pyx_n_s_mpfr_buildopt_gmpinternals_p; + PyObject *__pyx_n_s_mpfr_buildopt_sharedcache_p; + PyObject *__pyx_n_s_mpfr_buildopt_tls_p; + PyObject *__pyx_n_s_mpfr_buildopt_tune_case; + PyObject *__pyx_n_s_mpfr_can_round; + PyObject *__pyx_n_s_mpfr_cbrt; + PyObject *__pyx_n_s_mpfr_ceil; + PyObject *__pyx_n_s_mpfr_check_range; + PyObject *__pyx_n_s_mpfr_clear; + PyObject *__pyx_n_s_mpfr_clear_divby0; + PyObject *__pyx_n_s_mpfr_clear_erangeflag; + PyObject *__pyx_n_s_mpfr_clear_flags; + PyObject *__pyx_n_s_mpfr_clear_inexflag; + PyObject *__pyx_n_s_mpfr_clear_nanflag; + PyObject *__pyx_n_s_mpfr_clear_overflow; + PyObject *__pyx_n_s_mpfr_clear_underflow; + PyObject *__pyx_n_s_mpfr_clears; + PyObject *__pyx_n_s_mpfr_cmp; + PyObject *__pyx_n_s_mpfr_cmpabs; + PyObject *__pyx_n_s_mpfr_const_catalan; + PyObject *__pyx_n_s_mpfr_const_euler; + PyObject *__pyx_n_s_mpfr_const_log2; + PyObject *__pyx_n_s_mpfr_const_pi; + PyObject *__pyx_n_s_mpfr_copysign; + PyObject *__pyx_n_s_mpfr_cos; + PyObject *__pyx_n_s_mpfr_cosh; + PyObject *__pyx_n_s_mpfr_cot; + PyObject *__pyx_n_s_mpfr_coth; + PyObject *__pyx_n_s_mpfr_csc; + PyObject *__pyx_n_s_mpfr_csch; + PyObject *__pyx_n_s_mpfr_digamma; + PyObject *__pyx_n_s_mpfr_dim; + PyObject *__pyx_n_s_mpfr_div; + PyObject *__pyx_n_s_mpfr_divby0_p; + PyObject *__pyx_n_s_mpfr_eint; + PyObject *__pyx_n_s_mpfr_equal_p; + PyObject *__pyx_n_s_mpfr_erangeflag_p; + PyObject *__pyx_n_s_mpfr_erf; + PyObject *__pyx_n_s_mpfr_erfc; + PyObject *__pyx_n_s_mpfr_exp; + PyObject *__pyx_n_s_mpfr_exp10; + PyObject *__pyx_n_s_mpfr_exp2; + PyObject *__pyx_n_s_mpfr_expm1; + PyObject *__pyx_n_s_mpfr_fac_ui; + PyObject *__pyx_n_s_mpfr_fits_slong_p; + PyObject *__pyx_n_s_mpfr_fits_ulong_p; + PyObject *__pyx_n_s_mpfr_flags_clear; + PyObject *__pyx_n_s_mpfr_flags_restore; + PyObject *__pyx_n_s_mpfr_flags_save; + PyObject *__pyx_n_s_mpfr_flags_set; + PyObject *__pyx_n_s_mpfr_flags_test; + PyObject *__pyx_n_s_mpfr_floor; + PyObject *__pyx_n_s_mpfr_fma; + PyObject *__pyx_n_s_mpfr_fmma; + PyObject *__pyx_n_s_mpfr_fmms; + PyObject *__pyx_n_s_mpfr_fmod; + PyObject *__pyx_n_s_mpfr_fmodquo; + PyObject *__pyx_n_s_mpfr_fms; + PyObject *__pyx_n_s_mpfr_frac; + PyObject *__pyx_n_s_mpfr_free_cache; + PyObject *__pyx_n_s_mpfr_free_cache2; + PyObject *__pyx_n_s_mpfr_free_pool; + PyObject *__pyx_n_s_mpfr_frexp; + PyObject *__pyx_n_s_mpfr_gamma; + PyObject *__pyx_n_s_mpfr_gamma_inc; + PyObject *__pyx_n_s_mpfr_get_d; + PyObject *__pyx_n_s_mpfr_get_d_2exp; + PyObject *__pyx_n_s_mpfr_get_default_prec; + PyObject *__pyx_n_s_mpfr_get_default_rounding_mode; + PyObject *__pyx_n_s_mpfr_get_emax; + PyObject *__pyx_n_s_mpfr_get_emax_max; + PyObject *__pyx_n_s_mpfr_get_emax_min; + PyObject *__pyx_n_s_mpfr_get_emin; + PyObject *__pyx_n_s_mpfr_get_emin_max; + PyObject *__pyx_n_s_mpfr_get_emin_min; + PyObject *__pyx_n_s_mpfr_get_exp; + PyObject *__pyx_n_s_mpfr_get_patches; + PyObject *__pyx_n_s_mpfr_get_prec; + PyObject *__pyx_n_s_mpfr_get_si; + PyObject *__pyx_n_s_mpfr_get_str; + PyObject *__pyx_n_s_mpfr_get_ui; + PyObject *__pyx_n_s_mpfr_get_version; + PyObject *__pyx_n_s_mpfr_get_z; + PyObject *__pyx_n_s_mpfr_get_z_2exp; + PyObject *__pyx_n_s_mpfr_greater_p; + PyObject *__pyx_n_s_mpfr_greaterequal_p; + PyObject *__pyx_n_s_mpfr_hypot; + PyObject *__pyx_n_s_mpfr_inexflag_p; + PyObject *__pyx_n_s_mpfr_inf_p; + PyObject *__pyx_n_s_mpfr_init; + PyObject *__pyx_n_s_mpfr_init2; + PyObject *__pyx_n_s_mpfr_initialized_p; + PyObject *__pyx_n_s_mpfr_inits; + PyObject *__pyx_n_s_mpfr_inits2; + PyObject *__pyx_n_s_mpfr_integer_p; + PyObject *__pyx_n_s_mpfr_j0; + PyObject *__pyx_n_s_mpfr_j1; + PyObject *__pyx_n_s_mpfr_jn; + PyObject *__pyx_n_s_mpfr_less_p; + PyObject *__pyx_n_s_mpfr_lessequal_p; + PyObject *__pyx_n_s_mpfr_lessgreater_p; + PyObject *__pyx_n_s_mpfr_lgamma; + PyObject *__pyx_n_s_mpfr_li2; + PyObject *__pyx_n_s_mpfr_lngamma; + PyObject *__pyx_n_s_mpfr_log; + PyObject *__pyx_n_s_mpfr_log10; + PyObject *__pyx_n_s_mpfr_log1p; + PyObject *__pyx_n_s_mpfr_log2; + PyObject *__pyx_n_s_mpfr_log_ui; + PyObject *__pyx_n_s_mpfr_max; + PyObject *__pyx_n_s_mpfr_min; + PyObject *__pyx_n_s_mpfr_min_prec; + PyObject *__pyx_n_s_mpfr_modf; + PyObject *__pyx_n_s_mpfr_mp_memory_cleanup; + PyObject *__pyx_kp_u_mpfr_mp_memory_cleanup_returned; + PyObject *__pyx_n_s_mpfr_mul; + PyObject *__pyx_n_s_mpfr_nan_p; + PyObject *__pyx_n_s_mpfr_nanflag_p; + PyObject *__pyx_n_s_mpfr_neg; + PyObject *__pyx_n_s_mpfr_nextabove; + PyObject *__pyx_n_s_mpfr_nextbelow; + PyObject *__pyx_n_s_mpfr_nexttoward; + PyObject *__pyx_n_s_mpfr_number_p; + PyObject *__pyx_n_s_mpfr_overflow_p; + PyObject *__pyx_n_s_mpfr_pow; + PyObject *__pyx_n_s_mpfr_prec_round; + PyObject *__pyx_n_s_mpfr_print_rnd_mode; + PyObject *__pyx_kp_s_mpfr_pyx; + PyObject *__pyx_n_s_mpfr_rec_sqrt; + PyObject *__pyx_n_s_mpfr_regular_p; + PyObject *__pyx_n_s_mpfr_remainder; + PyObject *__pyx_n_s_mpfr_remquo; + PyObject *__pyx_n_s_mpfr_rint; + PyObject *__pyx_n_s_mpfr_rint_ceil; + PyObject *__pyx_n_s_mpfr_rint_floor; + PyObject *__pyx_n_s_mpfr_rint_round; + PyObject *__pyx_n_s_mpfr_rint_roundeven; + PyObject *__pyx_n_s_mpfr_rint_trunc; + PyObject *__pyx_n_s_mpfr_root; + PyObject *__pyx_kp_u_mpfr_root_is_deprecated_Use_mpfr; + PyObject *__pyx_n_s_mpfr_root_no_warn; + PyObject *__pyx_n_s_mpfr_rootn_ui; + PyObject *__pyx_n_s_mpfr_round; + PyObject *__pyx_n_s_mpfr_roundeven; + PyObject *__pyx_n_s_mpfr_sec; + PyObject *__pyx_n_s_mpfr_sech; + PyObject *__pyx_n_s_mpfr_set; + PyObject *__pyx_n_s_mpfr_set_d; + PyObject *__pyx_n_s_mpfr_set_default_prec; + PyObject *__pyx_n_s_mpfr_set_default_rounding_mode; + PyObject *__pyx_n_s_mpfr_set_divby0; + PyObject *__pyx_n_s_mpfr_set_emax; + PyObject *__pyx_n_s_mpfr_set_emin; + PyObject *__pyx_n_s_mpfr_set_erangeflag; + PyObject *__pyx_n_s_mpfr_set_exp; + PyObject *__pyx_n_s_mpfr_set_inexflag; + PyObject *__pyx_n_s_mpfr_set_inf; + PyObject *__pyx_n_s_mpfr_set_nan; + PyObject *__pyx_n_s_mpfr_set_nanflag; + PyObject *__pyx_n_s_mpfr_set_overflow; + PyObject *__pyx_n_s_mpfr_set_prec; + PyObject *__pyx_n_s_mpfr_set_si; + PyObject *__pyx_n_s_mpfr_set_si_2exp; + PyObject *__pyx_n_s_mpfr_set_str; + PyObject *__pyx_n_s_mpfr_set_ui; + PyObject *__pyx_n_s_mpfr_set_ui_2exp; + PyObject *__pyx_n_s_mpfr_set_underflow; + PyObject *__pyx_n_s_mpfr_set_z; + PyObject *__pyx_n_s_mpfr_set_z_2exp; + PyObject *__pyx_n_s_mpfr_set_zero; + PyObject *__pyx_n_s_mpfr_setsign; + PyObject *__pyx_n_s_mpfr_sgn; + PyObject *__pyx_n_s_mpfr_signbit; + PyObject *__pyx_n_s_mpfr_sin; + PyObject *__pyx_n_s_mpfr_sin_cos; + PyObject *__pyx_n_s_mpfr_sinh; + PyObject *__pyx_n_s_mpfr_sinh_cosh; + PyObject *__pyx_n_s_mpfr_sqr; + PyObject *__pyx_n_s_mpfr_sqrt; + PyObject *__pyx_n_s_mpfr_strtofr; + PyObject *__pyx_n_s_mpfr_sub; + PyObject *__pyx_n_s_mpfr_subnormalize; + PyObject *__pyx_n_s_mpfr_sum; + PyObject *__pyx_n_s_mpfr_swap; + PyObject *__pyx_n_s_mpfr_tan; + PyObject *__pyx_n_s_mpfr_tanh; + PyObject *__pyx_n_s_mpfr_trunc; + PyObject *__pyx_n_s_mpfr_underflow_p; + PyObject *__pyx_n_s_mpfr_unordered_p; + PyObject *__pyx_n_s_mpfr_y0; + PyObject *__pyx_n_s_mpfr_y1; + PyObject *__pyx_n_s_mpfr_yn; + PyObject *__pyx_n_s_mpfr_zero_p; + PyObject *__pyx_n_s_mpfr_zeta; + PyObject *__pyx_n_s_mpfr_zeta_ui; + PyObject *__pyx_n_s_mpz_get_str; + PyObject *__pyx_n_s_mpz_set_str; + PyObject *__pyx_n_s_n; + PyObject *__pyx_kp_u_n_should_be_either_0_or_at_least; + PyObject *__pyx_n_s_name; + PyObject *__pyx_kp_u_new_exponent_for_emin_is_outside; + PyObject *__pyx_kp_s_no_default___reduce___due_to_non; + PyObject *__pyx_n_s_op; + PyObject *__pyx_n_s_op1; + PyObject *__pyx_n_s_op2; + PyObject *__pyx_n_s_op3; + PyObject *__pyx_n_s_op4; + PyObject *__pyx_n_s_output; + PyObject *__pyx_n_s_output_as_bytes; + PyObject *__pyx_n_s_patches; + PyObject *__pyx_n_s_patchlevel; + PyObject *__pyx_n_s_pointers; + PyObject *__pyx_n_s_prec; + PyObject *__pyx_kp_u_precision_should_be_between_and; + PyObject *__pyx_n_s_pyx_state; + PyObject *__pyx_n_s_quotient; + PyObject *__pyx_n_s_r; + PyObject *__pyx_n_s_range; + PyObject *__pyx_n_s_rc; + PyObject *__pyx_n_s_reduce; + PyObject *__pyx_n_s_reduce_cython; + PyObject *__pyx_n_s_reduce_ex; + PyObject *__pyx_n_s_rnd; + PyObject *__pyx_n_s_rnd1; + PyObject *__pyx_n_s_rnd2; + PyObject *__pyx_n_s_rop; + PyObject *__pyx_n_s_rounding_mode; + PyObject *__pyx_n_s_rv; + PyObject *__pyx_n_s_s; + PyObject *__pyx_n_s_self; + PyObject *__pyx_kp_s_self__value_cannot_be_converted; + PyObject *__pyx_n_s_setstate; + PyObject *__pyx_n_s_setstate_cython; + PyObject *__pyx_n_s_sign; + PyObject *__pyx_n_s_signp; + PyObject *__pyx_n_s_sop; + PyObject *__pyx_n_s_spec; + PyObject *__pyx_n_s_split; + PyObject *__pyx_n_s_startptr; + PyObject *__pyx_kp_s_stringsource; + PyObject *__pyx_n_s_sys; + PyObject *__pyx_n_s_t; + PyObject *__pyx_n_s_tab; + PyObject *__pyx_n_s_template; + PyObject *__pyx_n_s_template_bytes; + PyObject *__pyx_n_s_ternary; + PyObject *__pyx_n_s_ternary_pair; + PyObject *__pyx_n_s_test; + PyObject *__pyx_n_s_thresholds; + PyObject *__pyx_n_s_version; + PyObject *__pyx_n_s_version_info; + PyObject *__pyx_n_s_warn; + PyObject *__pyx_n_s_warnings; + PyObject *__pyx_n_s_way; + PyObject *__pyx_n_s_x; + PyObject *__pyx_n_s_y; + PyObject *__pyx_int_3; + PyObject *__pyx_tuple_; + PyObject *__pyx_tuple__2; + PyObject *__pyx_tuple__3; + PyObject *__pyx_tuple__4; + PyObject *__pyx_tuple__5; + PyObject *__pyx_tuple__6; + PyObject *__pyx_tuple__7; + PyObject *__pyx_tuple__8; + PyObject *__pyx_tuple__9; + PyObject *__pyx_tuple__10; + PyObject *__pyx_tuple__11; + PyObject *__pyx_tuple__13; + PyObject *__pyx_tuple__15; + PyObject *__pyx_tuple__17; + PyObject *__pyx_tuple__19; + PyObject *__pyx_tuple__23; + PyObject *__pyx_tuple__25; + PyObject *__pyx_tuple__27; + PyObject *__pyx_tuple__29; + PyObject *__pyx_tuple__31; + PyObject *__pyx_tuple__35; + PyObject *__pyx_tuple__40; + PyObject *__pyx_tuple__46; + PyObject *__pyx_tuple__50; + PyObject *__pyx_tuple__52; + PyObject *__pyx_tuple__55; + PyObject *__pyx_tuple__58; + PyObject *__pyx_tuple__60; + PyObject *__pyx_tuple__64; + PyObject *__pyx_tuple__66; + PyObject *__pyx_tuple__68; + PyObject *__pyx_tuple__71; + PyObject *__pyx_tuple__73; + PyObject *__pyx_tuple__76; + PyObject *__pyx_tuple__85; + PyObject *__pyx_tuple__93; + PyObject *__pyx_tuple__121; + PyObject *__pyx_tuple__129; + PyObject *__pyx_tuple__145; + PyObject *__pyx_tuple__148; + PyObject *__pyx_tuple__158; + PyObject *__pyx_tuple__163; + PyObject *__pyx_tuple__166; + PyObject *__pyx_tuple__170; + PyObject *__pyx_tuple__173; + PyObject *__pyx_tuple__179; + PyObject *__pyx_tuple__182; + PyObject *__pyx_tuple__184; + PyObject *__pyx_tuple__186; + PyObject *__pyx_tuple__189; + PyObject *__pyx_tuple__201; + PyObject *__pyx_tuple__203; + PyObject *__pyx_tuple__205; + PyObject *__pyx_tuple__210; + PyObject *__pyx_tuple__213; + PyObject *__pyx_tuple__215; + PyObject *__pyx_tuple__218; + PyObject *__pyx_tuple__226; + PyObject *__pyx_tuple__229; + PyObject *__pyx_tuple__232; + PyObject *__pyx_tuple__234; + PyObject *__pyx_tuple__236; + PyObject *__pyx_tuple__243; + PyObject *__pyx_tuple__247; + PyObject *__pyx_tuple__254; + PyObject *__pyx_tuple__276; + PyObject *__pyx_tuple__281; + PyObject *__pyx_codeobj__14; + PyObject *__pyx_codeobj__16; + PyObject *__pyx_codeobj__18; + PyObject *__pyx_codeobj__20; + PyObject *__pyx_codeobj__21; + PyObject *__pyx_codeobj__22; + PyObject *__pyx_codeobj__24; + PyObject *__pyx_codeobj__26; + PyObject *__pyx_codeobj__28; + PyObject *__pyx_codeobj__30; + PyObject *__pyx_codeobj__32; + PyObject *__pyx_codeobj__33; + PyObject *__pyx_codeobj__34; + PyObject *__pyx_codeobj__36; + PyObject *__pyx_codeobj__37; + PyObject *__pyx_codeobj__38; + PyObject *__pyx_codeobj__39; + PyObject *__pyx_codeobj__41; + PyObject *__pyx_codeobj__42; + PyObject *__pyx_codeobj__43; + PyObject *__pyx_codeobj__44; + PyObject *__pyx_codeobj__45; + PyObject *__pyx_codeobj__47; + PyObject *__pyx_codeobj__48; + PyObject *__pyx_codeobj__49; + PyObject *__pyx_codeobj__51; + PyObject *__pyx_codeobj__53; + PyObject *__pyx_codeobj__54; + PyObject *__pyx_codeobj__56; + PyObject *__pyx_codeobj__57; + PyObject *__pyx_codeobj__59; + PyObject *__pyx_codeobj__61; + PyObject *__pyx_codeobj__62; + PyObject *__pyx_codeobj__63; + PyObject *__pyx_codeobj__65; + PyObject *__pyx_codeobj__67; + PyObject *__pyx_codeobj__69; + PyObject *__pyx_codeobj__70; + PyObject *__pyx_codeobj__72; + PyObject *__pyx_codeobj__74; + PyObject *__pyx_codeobj__75; + PyObject *__pyx_codeobj__77; + PyObject *__pyx_codeobj__78; + PyObject *__pyx_codeobj__79; + PyObject *__pyx_codeobj__80; + PyObject *__pyx_codeobj__81; + PyObject *__pyx_codeobj__82; + PyObject *__pyx_codeobj__83; + PyObject *__pyx_codeobj__84; + PyObject *__pyx_codeobj__86; + PyObject *__pyx_codeobj__87; + PyObject *__pyx_codeobj__88; + PyObject *__pyx_codeobj__89; + PyObject *__pyx_codeobj__90; + PyObject *__pyx_codeobj__91; + PyObject *__pyx_codeobj__92; + PyObject *__pyx_codeobj__94; + PyObject *__pyx_codeobj__95; + PyObject *__pyx_codeobj__96; + PyObject *__pyx_codeobj__97; + PyObject *__pyx_codeobj__98; + PyObject *__pyx_codeobj__99; + PyObject *__pyx_codeobj__100; + PyObject *__pyx_codeobj__101; + PyObject *__pyx_codeobj__102; + PyObject *__pyx_codeobj__103; + PyObject *__pyx_codeobj__104; + PyObject *__pyx_codeobj__105; + PyObject *__pyx_codeobj__106; + PyObject *__pyx_codeobj__107; + PyObject *__pyx_codeobj__108; + PyObject *__pyx_codeobj__109; + PyObject *__pyx_codeobj__110; + PyObject *__pyx_codeobj__111; + PyObject *__pyx_codeobj__112; + PyObject *__pyx_codeobj__113; + PyObject *__pyx_codeobj__114; + PyObject *__pyx_codeobj__115; + PyObject *__pyx_codeobj__116; + PyObject *__pyx_codeobj__117; + PyObject *__pyx_codeobj__118; + PyObject *__pyx_codeobj__119; + PyObject *__pyx_codeobj__120; + PyObject *__pyx_codeobj__122; + PyObject *__pyx_codeobj__123; + PyObject *__pyx_codeobj__124; + PyObject *__pyx_codeobj__125; + PyObject *__pyx_codeobj__126; + PyObject *__pyx_codeobj__127; + PyObject *__pyx_codeobj__128; + PyObject *__pyx_codeobj__130; + PyObject *__pyx_codeobj__131; + PyObject *__pyx_codeobj__132; + PyObject *__pyx_codeobj__133; + PyObject *__pyx_codeobj__134; + PyObject *__pyx_codeobj__135; + PyObject *__pyx_codeobj__136; + PyObject *__pyx_codeobj__137; + PyObject *__pyx_codeobj__138; + PyObject *__pyx_codeobj__139; + PyObject *__pyx_codeobj__140; + PyObject *__pyx_codeobj__141; + PyObject *__pyx_codeobj__142; + PyObject *__pyx_codeobj__143; + PyObject *__pyx_codeobj__144; + PyObject *__pyx_codeobj__146; + PyObject *__pyx_codeobj__147; + PyObject *__pyx_codeobj__149; + PyObject *__pyx_codeobj__150; + PyObject *__pyx_codeobj__151; + PyObject *__pyx_codeobj__152; + PyObject *__pyx_codeobj__153; + PyObject *__pyx_codeobj__154; + PyObject *__pyx_codeobj__155; + PyObject *__pyx_codeobj__156; + PyObject *__pyx_codeobj__157; + PyObject *__pyx_codeobj__159; + PyObject *__pyx_codeobj__160; + PyObject *__pyx_codeobj__161; + PyObject *__pyx_codeobj__162; + PyObject *__pyx_codeobj__164; + PyObject *__pyx_codeobj__165; + PyObject *__pyx_codeobj__167; + PyObject *__pyx_codeobj__168; + PyObject *__pyx_codeobj__169; + PyObject *__pyx_codeobj__171; + PyObject *__pyx_codeobj__172; + PyObject *__pyx_codeobj__174; + PyObject *__pyx_codeobj__175; + PyObject *__pyx_codeobj__176; + PyObject *__pyx_codeobj__177; + PyObject *__pyx_codeobj__178; + PyObject *__pyx_codeobj__180; + PyObject *__pyx_codeobj__181; + PyObject *__pyx_codeobj__183; + PyObject *__pyx_codeobj__185; + PyObject *__pyx_codeobj__187; + PyObject *__pyx_codeobj__188; + PyObject *__pyx_codeobj__190; + PyObject *__pyx_codeobj__191; + PyObject *__pyx_codeobj__192; + PyObject *__pyx_codeobj__193; + PyObject *__pyx_codeobj__194; + PyObject *__pyx_codeobj__195; + PyObject *__pyx_codeobj__196; + PyObject *__pyx_codeobj__197; + PyObject *__pyx_codeobj__198; + PyObject *__pyx_codeobj__199; + PyObject *__pyx_codeobj__200; + PyObject *__pyx_codeobj__202; + PyObject *__pyx_codeobj__204; + PyObject *__pyx_codeobj__206; + PyObject *__pyx_codeobj__207; + PyObject *__pyx_codeobj__208; + PyObject *__pyx_codeobj__209; + PyObject *__pyx_codeobj__211; + PyObject *__pyx_codeobj__212; + PyObject *__pyx_codeobj__214; + PyObject *__pyx_codeobj__216; + PyObject *__pyx_codeobj__217; + PyObject *__pyx_codeobj__219; + PyObject *__pyx_codeobj__220; + PyObject *__pyx_codeobj__221; + PyObject *__pyx_codeobj__222; + PyObject *__pyx_codeobj__223; + PyObject *__pyx_codeobj__224; + PyObject *__pyx_codeobj__225; + PyObject *__pyx_codeobj__227; + PyObject *__pyx_codeobj__228; + PyObject *__pyx_codeobj__230; + PyObject *__pyx_codeobj__231; + PyObject *__pyx_codeobj__233; + PyObject *__pyx_codeobj__235; + PyObject *__pyx_codeobj__237; + PyObject *__pyx_codeobj__238; + PyObject *__pyx_codeobj__239; + PyObject *__pyx_codeobj__240; + PyObject *__pyx_codeobj__241; + PyObject *__pyx_codeobj__242; + PyObject *__pyx_codeobj__244; + PyObject *__pyx_codeobj__245; + PyObject *__pyx_codeobj__246; + PyObject *__pyx_codeobj__248; + PyObject *__pyx_codeobj__249; + PyObject *__pyx_codeobj__250; + PyObject *__pyx_codeobj__251; + PyObject *__pyx_codeobj__252; + PyObject *__pyx_codeobj__253; + PyObject *__pyx_codeobj__255; + PyObject *__pyx_codeobj__256; + PyObject *__pyx_codeobj__257; + PyObject *__pyx_codeobj__258; + PyObject *__pyx_codeobj__259; + PyObject *__pyx_codeobj__260; + PyObject *__pyx_codeobj__261; + PyObject *__pyx_codeobj__262; + PyObject *__pyx_codeobj__263; + PyObject *__pyx_codeobj__264; + PyObject *__pyx_codeobj__265; + PyObject *__pyx_codeobj__266; + PyObject *__pyx_codeobj__267; + PyObject *__pyx_codeobj__268; + PyObject *__pyx_codeobj__269; + PyObject *__pyx_codeobj__270; + PyObject *__pyx_codeobj__271; + PyObject *__pyx_codeobj__272; + PyObject *__pyx_codeobj__273; + PyObject *__pyx_codeobj__274; + PyObject *__pyx_codeobj__275; + PyObject *__pyx_codeobj__277; + PyObject *__pyx_codeobj__278; + PyObject *__pyx_codeobj__279; + PyObject *__pyx_codeobj__280; + PyObject *__pyx_codeobj__282; +} __pyx_mstate; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { + extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) + +#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) + +#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstate __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_clear(PyObject *m) { + __pyx_mstate *clear_module_state = __pyx_mstate(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); + #endif + Py_CLEAR(clear_module_state->__pyx_ptype_4mpfr_Mpz_t); + Py_CLEAR(clear_module_state->__pyx_type_4mpfr_Mpz_t); + Py_CLEAR(clear_module_state->__pyx_ptype_4mpfr_Mpfr_t); + Py_CLEAR(clear_module_state->__pyx_type_4mpfr_Mpfr_t); + Py_CLEAR(clear_module_state->__pyx_kp_u_Base_must_satisfy_2_base_62_or_2); + Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_convert_None_to_mpfr_Mpfr); + Py_CLEAR(clear_module_state->__pyx_n_s_DeprecationWarning); + Py_CLEAR(clear_module_state->__pyx_kp_u_Error_during_string_conversion); + Py_CLEAR(clear_module_state->__pyx_n_s_LONG_MAX); + Py_CLEAR(clear_module_state->__pyx_n_s_LONG_MIN); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_EMAX_DEFAULT); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_EMIN_DEFAULT); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_FLAGS_ALL); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_FLAGS_DIVBY0); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_FLAGS_ERANGE); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_FLAGS_INEXACT); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_FLAGS_NAN); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_FLAGS_OVERFLOW); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_FLAGS_UNDERFLOW); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_FREE_GLOBAL_CACHE); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_FREE_LOCAL_CACHE); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_PREC_MAX); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_PREC_MIN); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_RNDA); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_RNDD); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_RNDF); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_RNDN); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_RNDU); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_RNDZ); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_VERSION); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_VERSION_MAJOR); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_VERSION_MINOR); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_VERSION_NUM); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_VERSION_PATCHLEVEL); + Py_CLEAR(clear_module_state->__pyx_n_s_MPFR_VERSION_STRING); + Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError); + Py_CLEAR(clear_module_state->__pyx_n_s_Mpfr_t); + Py_CLEAR(clear_module_state->__pyx_n_s_Mpfr_t___reduce_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_Mpfr_t___setstate_cython); + Py_CLEAR(clear_module_state->__pyx_kp_u_Mpfr_t_instance_is_already_initi); + Py_CLEAR(clear_module_state->__pyx_kp_u_Mpfr_t_instance_should_be_initia); + Py_CLEAR(clear_module_state->__pyx_n_s_Mpz_t); + Py_CLEAR(clear_module_state->__pyx_n_s_Mpz_t___reduce_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_Mpz_t___setstate_cython); + Py_CLEAR(clear_module_state->__pyx_kp_u_Not_a_valid_number_for_base); + Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError); + Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); + Py_CLEAR(clear_module_state->__pyx_n_s_ULONG_MAX); + Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); + Py_CLEAR(clear_module_state->__pyx_n_s__12); + Py_CLEAR(clear_module_state->__pyx_n_s__283); + Py_CLEAR(clear_module_state->__pyx_n_s_arg); + Py_CLEAR(clear_module_state->__pyx_n_s_args); + Py_CLEAR(clear_module_state->__pyx_n_u_ascii); + Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines); + Py_CLEAR(clear_module_state->__pyx_n_s_b); + Py_CLEAR(clear_module_state->__pyx_n_s_base); + Py_CLEAR(clear_module_state->__pyx_kp_u_base_must_satisfy_2_base_62_or_b); + Py_CLEAR(clear_module_state->__pyx_kp_u_base_should_be_in_the_range_2_to); + Py_CLEAR(clear_module_state->__pyx_kp_u_base_should_be_zero_or_in_the_ra); + Py_CLEAR(clear_module_state->__pyx_n_s_bytes_s); + Py_CLEAR(clear_module_state->__pyx_n_s_c_digits); + Py_CLEAR(clear_module_state->__pyx_n_s_c_digits_alloc); + Py_CLEAR(clear_module_state->__pyx_n_s_c_digits_len); + Py_CLEAR(clear_module_state->__pyx_n_s_category); + Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); + Py_CLEAR(clear_module_state->__pyx_n_s_cop); + Py_CLEAR(clear_module_state->__pyx_n_s_d); + Py_CLEAR(clear_module_state->__pyx_n_s_digits); + Py_CLEAR(clear_module_state->__pyx_kp_u_disable); + Py_CLEAR(clear_module_state->__pyx_n_s_e); + Py_CLEAR(clear_module_state->__pyx_n_s_elt); + Py_CLEAR(clear_module_state->__pyx_kp_u_enable); + Py_CLEAR(clear_module_state->__pyx_n_s_encode); + Py_CLEAR(clear_module_state->__pyx_n_s_endindex); + Py_CLEAR(clear_module_state->__pyx_n_s_endptr); + Py_CLEAR(clear_module_state->__pyx_n_s_err); + Py_CLEAR(clear_module_state->__pyx_n_s_error_code); + Py_CLEAR(clear_module_state->__pyx_n_s_exp); + Py_CLEAR(clear_module_state->__pyx_n_s_exponent); + Py_CLEAR(clear_module_state->__pyx_kp_u_exponent_not_in_current_exponent); + Py_CLEAR(clear_module_state->__pyx_kp_u_flag_mask_contains_invalid_flags); + Py_CLEAR(clear_module_state->__pyx_n_s_flags); + Py_CLEAR(clear_module_state->__pyx_n_s_fop); + Py_CLEAR(clear_module_state->__pyx_n_s_format); + Py_CLEAR(clear_module_state->__pyx_n_s_freefunc); + Py_CLEAR(clear_module_state->__pyx_kp_u_gc); + Py_CLEAR(clear_module_state->__pyx_n_s_getstate); + Py_CLEAR(clear_module_state->__pyx_n_s_i); + Py_CLEAR(clear_module_state->__pyx_n_s_import); + Py_CLEAR(clear_module_state->__pyx_n_s_initializing); + Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_flag_mask); + Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_rounding_mode); + Py_CLEAR(clear_module_state->__pyx_n_s_iop); + Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine); + Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled); + Py_CLEAR(clear_module_state->__pyx_n_s_k); + Py_CLEAR(clear_module_state->__pyx_n_s_main); + Py_CLEAR(clear_module_state->__pyx_n_s_major); + Py_CLEAR(clear_module_state->__pyx_n_s_mask); + Py_CLEAR(clear_module_state->__pyx_n_s_minor); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_abs); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_acos); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_acosh); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_add); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_agm); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_ai); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_asin); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_asinh); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_asprintf); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_atan); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_atan2); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_atanh); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_beta); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_buildopt_decimal_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_buildopt_float128_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_buildopt_gmpinternals_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_buildopt_sharedcache_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_buildopt_tls_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_buildopt_tune_case); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_can_round); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_cbrt); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_ceil); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_check_range); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_clear); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_clear_divby0); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_clear_erangeflag); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_clear_flags); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_clear_inexflag); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_clear_nanflag); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_clear_overflow); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_clear_underflow); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_clears); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_cmp); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_cmpabs); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_const_catalan); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_const_euler); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_const_log2); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_const_pi); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_copysign); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_cos); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_cosh); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_cot); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_coth); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_csc); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_csch); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_digamma); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_dim); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_div); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_divby0_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_eint); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_equal_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_erangeflag_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_erf); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_erfc); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_exp); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_exp10); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_exp2); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_expm1); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_fac_ui); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_fits_slong_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_fits_ulong_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_flags_clear); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_flags_restore); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_flags_save); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_flags_set); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_flags_test); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_floor); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_fma); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_fmma); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_fmms); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_fmod); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_fmodquo); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_fms); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_frac); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_free_cache); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_free_cache2); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_free_pool); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_frexp); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_gamma); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_gamma_inc); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_d); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_d_2exp); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_default_prec); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_default_rounding_mode); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_emax); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_emax_max); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_emax_min); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_emin); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_emin_max); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_emin_min); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_exp); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_patches); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_prec); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_si); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_str); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_ui); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_version); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_z); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_get_z_2exp); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_greater_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_greaterequal_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_hypot); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_inexflag_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_inf_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_init); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_init2); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_initialized_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_inits); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_inits2); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_integer_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_j0); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_j1); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_jn); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_less_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_lessequal_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_lessgreater_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_lgamma); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_li2); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_lngamma); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_log); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_log10); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_log1p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_log2); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_log_ui); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_max); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_min); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_min_prec); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_modf); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_mp_memory_cleanup); + Py_CLEAR(clear_module_state->__pyx_kp_u_mpfr_mp_memory_cleanup_returned); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_mul); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_nan_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_nanflag_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_neg); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_nextabove); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_nextbelow); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_nexttoward); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_number_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_overflow_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_pow); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_prec_round); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_print_rnd_mode); + Py_CLEAR(clear_module_state->__pyx_kp_s_mpfr_pyx); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_rec_sqrt); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_regular_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_remainder); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_remquo); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_rint); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_rint_ceil); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_rint_floor); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_rint_round); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_rint_roundeven); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_rint_trunc); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_root); + Py_CLEAR(clear_module_state->__pyx_kp_u_mpfr_root_is_deprecated_Use_mpfr); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_root_no_warn); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_rootn_ui); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_round); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_roundeven); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_sec); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_sech); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_d); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_default_prec); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_default_rounding_mode); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_divby0); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_emax); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_emin); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_erangeflag); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_exp); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_inexflag); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_inf); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_nan); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_nanflag); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_overflow); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_prec); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_si); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_si_2exp); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_str); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_ui); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_ui_2exp); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_underflow); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_z); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_z_2exp); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_set_zero); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_setsign); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_sgn); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_signbit); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_sin); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_sin_cos); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_sinh); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_sinh_cosh); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_sqr); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_sqrt); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_strtofr); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_sub); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_subnormalize); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_sum); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_swap); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_tan); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_tanh); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_trunc); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_underflow_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_unordered_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_y0); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_y1); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_yn); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_zero_p); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_zeta); + Py_CLEAR(clear_module_state->__pyx_n_s_mpfr_zeta_ui); + Py_CLEAR(clear_module_state->__pyx_n_s_mpz_get_str); + Py_CLEAR(clear_module_state->__pyx_n_s_mpz_set_str); + Py_CLEAR(clear_module_state->__pyx_n_s_n); + Py_CLEAR(clear_module_state->__pyx_kp_u_n_should_be_either_0_or_at_least); + Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_kp_u_new_exponent_for_emin_is_outside); + Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non); + Py_CLEAR(clear_module_state->__pyx_n_s_op); + Py_CLEAR(clear_module_state->__pyx_n_s_op1); + Py_CLEAR(clear_module_state->__pyx_n_s_op2); + Py_CLEAR(clear_module_state->__pyx_n_s_op3); + Py_CLEAR(clear_module_state->__pyx_n_s_op4); + Py_CLEAR(clear_module_state->__pyx_n_s_output); + Py_CLEAR(clear_module_state->__pyx_n_s_output_as_bytes); + Py_CLEAR(clear_module_state->__pyx_n_s_patches); + Py_CLEAR(clear_module_state->__pyx_n_s_patchlevel); + Py_CLEAR(clear_module_state->__pyx_n_s_pointers); + Py_CLEAR(clear_module_state->__pyx_n_s_prec); + Py_CLEAR(clear_module_state->__pyx_kp_u_precision_should_be_between_and); + Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state); + Py_CLEAR(clear_module_state->__pyx_n_s_quotient); + Py_CLEAR(clear_module_state->__pyx_n_s_r); + Py_CLEAR(clear_module_state->__pyx_n_s_range); + Py_CLEAR(clear_module_state->__pyx_n_s_rc); + Py_CLEAR(clear_module_state->__pyx_n_s_reduce); + Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex); + Py_CLEAR(clear_module_state->__pyx_n_s_rnd); + Py_CLEAR(clear_module_state->__pyx_n_s_rnd1); + Py_CLEAR(clear_module_state->__pyx_n_s_rnd2); + Py_CLEAR(clear_module_state->__pyx_n_s_rop); + Py_CLEAR(clear_module_state->__pyx_n_s_rounding_mode); + Py_CLEAR(clear_module_state->__pyx_n_s_rv); + Py_CLEAR(clear_module_state->__pyx_n_s_s); + Py_CLEAR(clear_module_state->__pyx_n_s_self); + Py_CLEAR(clear_module_state->__pyx_kp_s_self__value_cannot_be_converted); + Py_CLEAR(clear_module_state->__pyx_n_s_setstate); + Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython); + Py_CLEAR(clear_module_state->__pyx_n_s_sign); + Py_CLEAR(clear_module_state->__pyx_n_s_signp); + Py_CLEAR(clear_module_state->__pyx_n_s_sop); + Py_CLEAR(clear_module_state->__pyx_n_s_spec); + Py_CLEAR(clear_module_state->__pyx_n_s_split); + Py_CLEAR(clear_module_state->__pyx_n_s_startptr); + Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource); + Py_CLEAR(clear_module_state->__pyx_n_s_sys); + Py_CLEAR(clear_module_state->__pyx_n_s_t); + Py_CLEAR(clear_module_state->__pyx_n_s_tab); + Py_CLEAR(clear_module_state->__pyx_n_s_template); + Py_CLEAR(clear_module_state->__pyx_n_s_template_bytes); + Py_CLEAR(clear_module_state->__pyx_n_s_ternary); + Py_CLEAR(clear_module_state->__pyx_n_s_ternary_pair); + Py_CLEAR(clear_module_state->__pyx_n_s_test); + Py_CLEAR(clear_module_state->__pyx_n_s_thresholds); + Py_CLEAR(clear_module_state->__pyx_n_s_version); + Py_CLEAR(clear_module_state->__pyx_n_s_version_info); + Py_CLEAR(clear_module_state->__pyx_n_s_warn); + Py_CLEAR(clear_module_state->__pyx_n_s_warnings); + Py_CLEAR(clear_module_state->__pyx_n_s_way); + Py_CLEAR(clear_module_state->__pyx_n_s_x); + Py_CLEAR(clear_module_state->__pyx_n_s_y); + Py_CLEAR(clear_module_state->__pyx_int_3); + Py_CLEAR(clear_module_state->__pyx_tuple_); + Py_CLEAR(clear_module_state->__pyx_tuple__2); + Py_CLEAR(clear_module_state->__pyx_tuple__3); + Py_CLEAR(clear_module_state->__pyx_tuple__4); + Py_CLEAR(clear_module_state->__pyx_tuple__5); + Py_CLEAR(clear_module_state->__pyx_tuple__6); + Py_CLEAR(clear_module_state->__pyx_tuple__7); + Py_CLEAR(clear_module_state->__pyx_tuple__8); + Py_CLEAR(clear_module_state->__pyx_tuple__9); + Py_CLEAR(clear_module_state->__pyx_tuple__10); + Py_CLEAR(clear_module_state->__pyx_tuple__11); + Py_CLEAR(clear_module_state->__pyx_tuple__13); + Py_CLEAR(clear_module_state->__pyx_tuple__15); + Py_CLEAR(clear_module_state->__pyx_tuple__17); + Py_CLEAR(clear_module_state->__pyx_tuple__19); + Py_CLEAR(clear_module_state->__pyx_tuple__23); + Py_CLEAR(clear_module_state->__pyx_tuple__25); + Py_CLEAR(clear_module_state->__pyx_tuple__27); + Py_CLEAR(clear_module_state->__pyx_tuple__29); + Py_CLEAR(clear_module_state->__pyx_tuple__31); + Py_CLEAR(clear_module_state->__pyx_tuple__35); + Py_CLEAR(clear_module_state->__pyx_tuple__40); + Py_CLEAR(clear_module_state->__pyx_tuple__46); + Py_CLEAR(clear_module_state->__pyx_tuple__50); + Py_CLEAR(clear_module_state->__pyx_tuple__52); + Py_CLEAR(clear_module_state->__pyx_tuple__55); + Py_CLEAR(clear_module_state->__pyx_tuple__58); + Py_CLEAR(clear_module_state->__pyx_tuple__60); + Py_CLEAR(clear_module_state->__pyx_tuple__64); + Py_CLEAR(clear_module_state->__pyx_tuple__66); + Py_CLEAR(clear_module_state->__pyx_tuple__68); + Py_CLEAR(clear_module_state->__pyx_tuple__71); + Py_CLEAR(clear_module_state->__pyx_tuple__73); + Py_CLEAR(clear_module_state->__pyx_tuple__76); + Py_CLEAR(clear_module_state->__pyx_tuple__85); + Py_CLEAR(clear_module_state->__pyx_tuple__93); + Py_CLEAR(clear_module_state->__pyx_tuple__121); + Py_CLEAR(clear_module_state->__pyx_tuple__129); + Py_CLEAR(clear_module_state->__pyx_tuple__145); + Py_CLEAR(clear_module_state->__pyx_tuple__148); + Py_CLEAR(clear_module_state->__pyx_tuple__158); + Py_CLEAR(clear_module_state->__pyx_tuple__163); + Py_CLEAR(clear_module_state->__pyx_tuple__166); + Py_CLEAR(clear_module_state->__pyx_tuple__170); + Py_CLEAR(clear_module_state->__pyx_tuple__173); + Py_CLEAR(clear_module_state->__pyx_tuple__179); + Py_CLEAR(clear_module_state->__pyx_tuple__182); + Py_CLEAR(clear_module_state->__pyx_tuple__184); + Py_CLEAR(clear_module_state->__pyx_tuple__186); + Py_CLEAR(clear_module_state->__pyx_tuple__189); + Py_CLEAR(clear_module_state->__pyx_tuple__201); + Py_CLEAR(clear_module_state->__pyx_tuple__203); + Py_CLEAR(clear_module_state->__pyx_tuple__205); + Py_CLEAR(clear_module_state->__pyx_tuple__210); + Py_CLEAR(clear_module_state->__pyx_tuple__213); + Py_CLEAR(clear_module_state->__pyx_tuple__215); + Py_CLEAR(clear_module_state->__pyx_tuple__218); + Py_CLEAR(clear_module_state->__pyx_tuple__226); + Py_CLEAR(clear_module_state->__pyx_tuple__229); + Py_CLEAR(clear_module_state->__pyx_tuple__232); + Py_CLEAR(clear_module_state->__pyx_tuple__234); + Py_CLEAR(clear_module_state->__pyx_tuple__236); + Py_CLEAR(clear_module_state->__pyx_tuple__243); + Py_CLEAR(clear_module_state->__pyx_tuple__247); + Py_CLEAR(clear_module_state->__pyx_tuple__254); + Py_CLEAR(clear_module_state->__pyx_tuple__276); + Py_CLEAR(clear_module_state->__pyx_tuple__281); + Py_CLEAR(clear_module_state->__pyx_codeobj__14); + Py_CLEAR(clear_module_state->__pyx_codeobj__16); + Py_CLEAR(clear_module_state->__pyx_codeobj__18); + Py_CLEAR(clear_module_state->__pyx_codeobj__20); + Py_CLEAR(clear_module_state->__pyx_codeobj__21); + Py_CLEAR(clear_module_state->__pyx_codeobj__22); + Py_CLEAR(clear_module_state->__pyx_codeobj__24); + Py_CLEAR(clear_module_state->__pyx_codeobj__26); + Py_CLEAR(clear_module_state->__pyx_codeobj__28); + Py_CLEAR(clear_module_state->__pyx_codeobj__30); + Py_CLEAR(clear_module_state->__pyx_codeobj__32); + Py_CLEAR(clear_module_state->__pyx_codeobj__33); + Py_CLEAR(clear_module_state->__pyx_codeobj__34); + Py_CLEAR(clear_module_state->__pyx_codeobj__36); + Py_CLEAR(clear_module_state->__pyx_codeobj__37); + Py_CLEAR(clear_module_state->__pyx_codeobj__38); + Py_CLEAR(clear_module_state->__pyx_codeobj__39); + Py_CLEAR(clear_module_state->__pyx_codeobj__41); + Py_CLEAR(clear_module_state->__pyx_codeobj__42); + Py_CLEAR(clear_module_state->__pyx_codeobj__43); + Py_CLEAR(clear_module_state->__pyx_codeobj__44); + Py_CLEAR(clear_module_state->__pyx_codeobj__45); + Py_CLEAR(clear_module_state->__pyx_codeobj__47); + Py_CLEAR(clear_module_state->__pyx_codeobj__48); + Py_CLEAR(clear_module_state->__pyx_codeobj__49); + Py_CLEAR(clear_module_state->__pyx_codeobj__51); + Py_CLEAR(clear_module_state->__pyx_codeobj__53); + Py_CLEAR(clear_module_state->__pyx_codeobj__54); + Py_CLEAR(clear_module_state->__pyx_codeobj__56); + Py_CLEAR(clear_module_state->__pyx_codeobj__57); + Py_CLEAR(clear_module_state->__pyx_codeobj__59); + Py_CLEAR(clear_module_state->__pyx_codeobj__61); + Py_CLEAR(clear_module_state->__pyx_codeobj__62); + Py_CLEAR(clear_module_state->__pyx_codeobj__63); + Py_CLEAR(clear_module_state->__pyx_codeobj__65); + Py_CLEAR(clear_module_state->__pyx_codeobj__67); + Py_CLEAR(clear_module_state->__pyx_codeobj__69); + Py_CLEAR(clear_module_state->__pyx_codeobj__70); + Py_CLEAR(clear_module_state->__pyx_codeobj__72); + Py_CLEAR(clear_module_state->__pyx_codeobj__74); + Py_CLEAR(clear_module_state->__pyx_codeobj__75); + Py_CLEAR(clear_module_state->__pyx_codeobj__77); + Py_CLEAR(clear_module_state->__pyx_codeobj__78); + Py_CLEAR(clear_module_state->__pyx_codeobj__79); + Py_CLEAR(clear_module_state->__pyx_codeobj__80); + Py_CLEAR(clear_module_state->__pyx_codeobj__81); + Py_CLEAR(clear_module_state->__pyx_codeobj__82); + Py_CLEAR(clear_module_state->__pyx_codeobj__83); + Py_CLEAR(clear_module_state->__pyx_codeobj__84); + Py_CLEAR(clear_module_state->__pyx_codeobj__86); + Py_CLEAR(clear_module_state->__pyx_codeobj__87); + Py_CLEAR(clear_module_state->__pyx_codeobj__88); + Py_CLEAR(clear_module_state->__pyx_codeobj__89); + Py_CLEAR(clear_module_state->__pyx_codeobj__90); + Py_CLEAR(clear_module_state->__pyx_codeobj__91); + Py_CLEAR(clear_module_state->__pyx_codeobj__92); + Py_CLEAR(clear_module_state->__pyx_codeobj__94); + Py_CLEAR(clear_module_state->__pyx_codeobj__95); + Py_CLEAR(clear_module_state->__pyx_codeobj__96); + Py_CLEAR(clear_module_state->__pyx_codeobj__97); + Py_CLEAR(clear_module_state->__pyx_codeobj__98); + Py_CLEAR(clear_module_state->__pyx_codeobj__99); + Py_CLEAR(clear_module_state->__pyx_codeobj__100); + Py_CLEAR(clear_module_state->__pyx_codeobj__101); + Py_CLEAR(clear_module_state->__pyx_codeobj__102); + Py_CLEAR(clear_module_state->__pyx_codeobj__103); + Py_CLEAR(clear_module_state->__pyx_codeobj__104); + Py_CLEAR(clear_module_state->__pyx_codeobj__105); + Py_CLEAR(clear_module_state->__pyx_codeobj__106); + Py_CLEAR(clear_module_state->__pyx_codeobj__107); + Py_CLEAR(clear_module_state->__pyx_codeobj__108); + Py_CLEAR(clear_module_state->__pyx_codeobj__109); + Py_CLEAR(clear_module_state->__pyx_codeobj__110); + Py_CLEAR(clear_module_state->__pyx_codeobj__111); + Py_CLEAR(clear_module_state->__pyx_codeobj__112); + Py_CLEAR(clear_module_state->__pyx_codeobj__113); + Py_CLEAR(clear_module_state->__pyx_codeobj__114); + Py_CLEAR(clear_module_state->__pyx_codeobj__115); + Py_CLEAR(clear_module_state->__pyx_codeobj__116); + Py_CLEAR(clear_module_state->__pyx_codeobj__117); + Py_CLEAR(clear_module_state->__pyx_codeobj__118); + Py_CLEAR(clear_module_state->__pyx_codeobj__119); + Py_CLEAR(clear_module_state->__pyx_codeobj__120); + Py_CLEAR(clear_module_state->__pyx_codeobj__122); + Py_CLEAR(clear_module_state->__pyx_codeobj__123); + Py_CLEAR(clear_module_state->__pyx_codeobj__124); + Py_CLEAR(clear_module_state->__pyx_codeobj__125); + Py_CLEAR(clear_module_state->__pyx_codeobj__126); + Py_CLEAR(clear_module_state->__pyx_codeobj__127); + Py_CLEAR(clear_module_state->__pyx_codeobj__128); + Py_CLEAR(clear_module_state->__pyx_codeobj__130); + Py_CLEAR(clear_module_state->__pyx_codeobj__131); + Py_CLEAR(clear_module_state->__pyx_codeobj__132); + Py_CLEAR(clear_module_state->__pyx_codeobj__133); + Py_CLEAR(clear_module_state->__pyx_codeobj__134); + Py_CLEAR(clear_module_state->__pyx_codeobj__135); + Py_CLEAR(clear_module_state->__pyx_codeobj__136); + Py_CLEAR(clear_module_state->__pyx_codeobj__137); + Py_CLEAR(clear_module_state->__pyx_codeobj__138); + Py_CLEAR(clear_module_state->__pyx_codeobj__139); + Py_CLEAR(clear_module_state->__pyx_codeobj__140); + Py_CLEAR(clear_module_state->__pyx_codeobj__141); + Py_CLEAR(clear_module_state->__pyx_codeobj__142); + Py_CLEAR(clear_module_state->__pyx_codeobj__143); + Py_CLEAR(clear_module_state->__pyx_codeobj__144); + Py_CLEAR(clear_module_state->__pyx_codeobj__146); + Py_CLEAR(clear_module_state->__pyx_codeobj__147); + Py_CLEAR(clear_module_state->__pyx_codeobj__149); + Py_CLEAR(clear_module_state->__pyx_codeobj__150); + Py_CLEAR(clear_module_state->__pyx_codeobj__151); + Py_CLEAR(clear_module_state->__pyx_codeobj__152); + Py_CLEAR(clear_module_state->__pyx_codeobj__153); + Py_CLEAR(clear_module_state->__pyx_codeobj__154); + Py_CLEAR(clear_module_state->__pyx_codeobj__155); + Py_CLEAR(clear_module_state->__pyx_codeobj__156); + Py_CLEAR(clear_module_state->__pyx_codeobj__157); + Py_CLEAR(clear_module_state->__pyx_codeobj__159); + Py_CLEAR(clear_module_state->__pyx_codeobj__160); + Py_CLEAR(clear_module_state->__pyx_codeobj__161); + Py_CLEAR(clear_module_state->__pyx_codeobj__162); + Py_CLEAR(clear_module_state->__pyx_codeobj__164); + Py_CLEAR(clear_module_state->__pyx_codeobj__165); + Py_CLEAR(clear_module_state->__pyx_codeobj__167); + Py_CLEAR(clear_module_state->__pyx_codeobj__168); + Py_CLEAR(clear_module_state->__pyx_codeobj__169); + Py_CLEAR(clear_module_state->__pyx_codeobj__171); + Py_CLEAR(clear_module_state->__pyx_codeobj__172); + Py_CLEAR(clear_module_state->__pyx_codeobj__174); + Py_CLEAR(clear_module_state->__pyx_codeobj__175); + Py_CLEAR(clear_module_state->__pyx_codeobj__176); + Py_CLEAR(clear_module_state->__pyx_codeobj__177); + Py_CLEAR(clear_module_state->__pyx_codeobj__178); + Py_CLEAR(clear_module_state->__pyx_codeobj__180); + Py_CLEAR(clear_module_state->__pyx_codeobj__181); + Py_CLEAR(clear_module_state->__pyx_codeobj__183); + Py_CLEAR(clear_module_state->__pyx_codeobj__185); + Py_CLEAR(clear_module_state->__pyx_codeobj__187); + Py_CLEAR(clear_module_state->__pyx_codeobj__188); + Py_CLEAR(clear_module_state->__pyx_codeobj__190); + Py_CLEAR(clear_module_state->__pyx_codeobj__191); + Py_CLEAR(clear_module_state->__pyx_codeobj__192); + Py_CLEAR(clear_module_state->__pyx_codeobj__193); + Py_CLEAR(clear_module_state->__pyx_codeobj__194); + Py_CLEAR(clear_module_state->__pyx_codeobj__195); + Py_CLEAR(clear_module_state->__pyx_codeobj__196); + Py_CLEAR(clear_module_state->__pyx_codeobj__197); + Py_CLEAR(clear_module_state->__pyx_codeobj__198); + Py_CLEAR(clear_module_state->__pyx_codeobj__199); + Py_CLEAR(clear_module_state->__pyx_codeobj__200); + Py_CLEAR(clear_module_state->__pyx_codeobj__202); + Py_CLEAR(clear_module_state->__pyx_codeobj__204); + Py_CLEAR(clear_module_state->__pyx_codeobj__206); + Py_CLEAR(clear_module_state->__pyx_codeobj__207); + Py_CLEAR(clear_module_state->__pyx_codeobj__208); + Py_CLEAR(clear_module_state->__pyx_codeobj__209); + Py_CLEAR(clear_module_state->__pyx_codeobj__211); + Py_CLEAR(clear_module_state->__pyx_codeobj__212); + Py_CLEAR(clear_module_state->__pyx_codeobj__214); + Py_CLEAR(clear_module_state->__pyx_codeobj__216); + Py_CLEAR(clear_module_state->__pyx_codeobj__217); + Py_CLEAR(clear_module_state->__pyx_codeobj__219); + Py_CLEAR(clear_module_state->__pyx_codeobj__220); + Py_CLEAR(clear_module_state->__pyx_codeobj__221); + Py_CLEAR(clear_module_state->__pyx_codeobj__222); + Py_CLEAR(clear_module_state->__pyx_codeobj__223); + Py_CLEAR(clear_module_state->__pyx_codeobj__224); + Py_CLEAR(clear_module_state->__pyx_codeobj__225); + Py_CLEAR(clear_module_state->__pyx_codeobj__227); + Py_CLEAR(clear_module_state->__pyx_codeobj__228); + Py_CLEAR(clear_module_state->__pyx_codeobj__230); + Py_CLEAR(clear_module_state->__pyx_codeobj__231); + Py_CLEAR(clear_module_state->__pyx_codeobj__233); + Py_CLEAR(clear_module_state->__pyx_codeobj__235); + Py_CLEAR(clear_module_state->__pyx_codeobj__237); + Py_CLEAR(clear_module_state->__pyx_codeobj__238); + Py_CLEAR(clear_module_state->__pyx_codeobj__239); + Py_CLEAR(clear_module_state->__pyx_codeobj__240); + Py_CLEAR(clear_module_state->__pyx_codeobj__241); + Py_CLEAR(clear_module_state->__pyx_codeobj__242); + Py_CLEAR(clear_module_state->__pyx_codeobj__244); + Py_CLEAR(clear_module_state->__pyx_codeobj__245); + Py_CLEAR(clear_module_state->__pyx_codeobj__246); + Py_CLEAR(clear_module_state->__pyx_codeobj__248); + Py_CLEAR(clear_module_state->__pyx_codeobj__249); + Py_CLEAR(clear_module_state->__pyx_codeobj__250); + Py_CLEAR(clear_module_state->__pyx_codeobj__251); + Py_CLEAR(clear_module_state->__pyx_codeobj__252); + Py_CLEAR(clear_module_state->__pyx_codeobj__253); + Py_CLEAR(clear_module_state->__pyx_codeobj__255); + Py_CLEAR(clear_module_state->__pyx_codeobj__256); + Py_CLEAR(clear_module_state->__pyx_codeobj__257); + Py_CLEAR(clear_module_state->__pyx_codeobj__258); + Py_CLEAR(clear_module_state->__pyx_codeobj__259); + Py_CLEAR(clear_module_state->__pyx_codeobj__260); + Py_CLEAR(clear_module_state->__pyx_codeobj__261); + Py_CLEAR(clear_module_state->__pyx_codeobj__262); + Py_CLEAR(clear_module_state->__pyx_codeobj__263); + Py_CLEAR(clear_module_state->__pyx_codeobj__264); + Py_CLEAR(clear_module_state->__pyx_codeobj__265); + Py_CLEAR(clear_module_state->__pyx_codeobj__266); + Py_CLEAR(clear_module_state->__pyx_codeobj__267); + Py_CLEAR(clear_module_state->__pyx_codeobj__268); + Py_CLEAR(clear_module_state->__pyx_codeobj__269); + Py_CLEAR(clear_module_state->__pyx_codeobj__270); + Py_CLEAR(clear_module_state->__pyx_codeobj__271); + Py_CLEAR(clear_module_state->__pyx_codeobj__272); + Py_CLEAR(clear_module_state->__pyx_codeobj__273); + Py_CLEAR(clear_module_state->__pyx_codeobj__274); + Py_CLEAR(clear_module_state->__pyx_codeobj__275); + Py_CLEAR(clear_module_state->__pyx_codeobj__277); + Py_CLEAR(clear_module_state->__pyx_codeobj__278); + Py_CLEAR(clear_module_state->__pyx_codeobj__279); + Py_CLEAR(clear_module_state->__pyx_codeobj__280); + Py_CLEAR(clear_module_state->__pyx_codeobj__282); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstate *traverse_module_state = __pyx_mstate(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + Py_VISIT(traverse_module_state->__pyx_empty_tuple); + Py_VISIT(traverse_module_state->__pyx_empty_bytes); + Py_VISIT(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); + #endif + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #endif + Py_VISIT(traverse_module_state->__pyx_ptype_4mpfr_Mpz_t); + Py_VISIT(traverse_module_state->__pyx_type_4mpfr_Mpz_t); + Py_VISIT(traverse_module_state->__pyx_ptype_4mpfr_Mpfr_t); + Py_VISIT(traverse_module_state->__pyx_type_4mpfr_Mpfr_t); + Py_VISIT(traverse_module_state->__pyx_kp_u_Base_must_satisfy_2_base_62_or_2); + Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_convert_None_to_mpfr_Mpfr); + Py_VISIT(traverse_module_state->__pyx_n_s_DeprecationWarning); + Py_VISIT(traverse_module_state->__pyx_kp_u_Error_during_string_conversion); + Py_VISIT(traverse_module_state->__pyx_n_s_LONG_MAX); + Py_VISIT(traverse_module_state->__pyx_n_s_LONG_MIN); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_EMAX_DEFAULT); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_EMIN_DEFAULT); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_FLAGS_ALL); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_FLAGS_DIVBY0); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_FLAGS_ERANGE); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_FLAGS_INEXACT); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_FLAGS_NAN); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_FLAGS_OVERFLOW); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_FLAGS_UNDERFLOW); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_FREE_GLOBAL_CACHE); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_FREE_LOCAL_CACHE); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_PREC_MAX); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_PREC_MIN); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_RNDA); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_RNDD); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_RNDF); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_RNDN); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_RNDU); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_RNDZ); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_VERSION); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_VERSION_MAJOR); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_VERSION_MINOR); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_VERSION_NUM); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_VERSION_PATCHLEVEL); + Py_VISIT(traverse_module_state->__pyx_n_s_MPFR_VERSION_STRING); + Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError); + Py_VISIT(traverse_module_state->__pyx_n_s_Mpfr_t); + Py_VISIT(traverse_module_state->__pyx_n_s_Mpfr_t___reduce_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_Mpfr_t___setstate_cython); + Py_VISIT(traverse_module_state->__pyx_kp_u_Mpfr_t_instance_is_already_initi); + Py_VISIT(traverse_module_state->__pyx_kp_u_Mpfr_t_instance_should_be_initia); + Py_VISIT(traverse_module_state->__pyx_n_s_Mpz_t); + Py_VISIT(traverse_module_state->__pyx_n_s_Mpz_t___reduce_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_Mpz_t___setstate_cython); + Py_VISIT(traverse_module_state->__pyx_kp_u_Not_a_valid_number_for_base); + Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError); + Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); + Py_VISIT(traverse_module_state->__pyx_n_s_ULONG_MAX); + Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); + Py_VISIT(traverse_module_state->__pyx_n_s__12); + Py_VISIT(traverse_module_state->__pyx_n_s__283); + Py_VISIT(traverse_module_state->__pyx_n_s_arg); + Py_VISIT(traverse_module_state->__pyx_n_s_args); + Py_VISIT(traverse_module_state->__pyx_n_u_ascii); + Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines); + Py_VISIT(traverse_module_state->__pyx_n_s_b); + Py_VISIT(traverse_module_state->__pyx_n_s_base); + Py_VISIT(traverse_module_state->__pyx_kp_u_base_must_satisfy_2_base_62_or_b); + Py_VISIT(traverse_module_state->__pyx_kp_u_base_should_be_in_the_range_2_to); + Py_VISIT(traverse_module_state->__pyx_kp_u_base_should_be_zero_or_in_the_ra); + Py_VISIT(traverse_module_state->__pyx_n_s_bytes_s); + Py_VISIT(traverse_module_state->__pyx_n_s_c_digits); + Py_VISIT(traverse_module_state->__pyx_n_s_c_digits_alloc); + Py_VISIT(traverse_module_state->__pyx_n_s_c_digits_len); + Py_VISIT(traverse_module_state->__pyx_n_s_category); + Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); + Py_VISIT(traverse_module_state->__pyx_n_s_cop); + Py_VISIT(traverse_module_state->__pyx_n_s_d); + Py_VISIT(traverse_module_state->__pyx_n_s_digits); + Py_VISIT(traverse_module_state->__pyx_kp_u_disable); + Py_VISIT(traverse_module_state->__pyx_n_s_e); + Py_VISIT(traverse_module_state->__pyx_n_s_elt); + Py_VISIT(traverse_module_state->__pyx_kp_u_enable); + Py_VISIT(traverse_module_state->__pyx_n_s_encode); + Py_VISIT(traverse_module_state->__pyx_n_s_endindex); + Py_VISIT(traverse_module_state->__pyx_n_s_endptr); + Py_VISIT(traverse_module_state->__pyx_n_s_err); + Py_VISIT(traverse_module_state->__pyx_n_s_error_code); + Py_VISIT(traverse_module_state->__pyx_n_s_exp); + Py_VISIT(traverse_module_state->__pyx_n_s_exponent); + Py_VISIT(traverse_module_state->__pyx_kp_u_exponent_not_in_current_exponent); + Py_VISIT(traverse_module_state->__pyx_kp_u_flag_mask_contains_invalid_flags); + Py_VISIT(traverse_module_state->__pyx_n_s_flags); + Py_VISIT(traverse_module_state->__pyx_n_s_fop); + Py_VISIT(traverse_module_state->__pyx_n_s_format); + Py_VISIT(traverse_module_state->__pyx_n_s_freefunc); + Py_VISIT(traverse_module_state->__pyx_kp_u_gc); + Py_VISIT(traverse_module_state->__pyx_n_s_getstate); + Py_VISIT(traverse_module_state->__pyx_n_s_i); + Py_VISIT(traverse_module_state->__pyx_n_s_import); + Py_VISIT(traverse_module_state->__pyx_n_s_initializing); + Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_flag_mask); + Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_rounding_mode); + Py_VISIT(traverse_module_state->__pyx_n_s_iop); + Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine); + Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled); + Py_VISIT(traverse_module_state->__pyx_n_s_k); + Py_VISIT(traverse_module_state->__pyx_n_s_main); + Py_VISIT(traverse_module_state->__pyx_n_s_major); + Py_VISIT(traverse_module_state->__pyx_n_s_mask); + Py_VISIT(traverse_module_state->__pyx_n_s_minor); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_abs); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_acos); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_acosh); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_add); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_agm); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_ai); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_asin); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_asinh); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_asprintf); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_atan); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_atan2); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_atanh); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_beta); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_buildopt_decimal_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_buildopt_float128_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_buildopt_gmpinternals_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_buildopt_sharedcache_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_buildopt_tls_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_buildopt_tune_case); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_can_round); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_cbrt); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_ceil); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_check_range); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_clear); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_clear_divby0); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_clear_erangeflag); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_clear_flags); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_clear_inexflag); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_clear_nanflag); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_clear_overflow); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_clear_underflow); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_clears); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_cmp); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_cmpabs); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_const_catalan); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_const_euler); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_const_log2); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_const_pi); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_copysign); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_cos); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_cosh); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_cot); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_coth); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_csc); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_csch); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_digamma); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_dim); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_div); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_divby0_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_eint); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_equal_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_erangeflag_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_erf); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_erfc); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_exp); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_exp10); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_exp2); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_expm1); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_fac_ui); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_fits_slong_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_fits_ulong_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_flags_clear); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_flags_restore); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_flags_save); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_flags_set); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_flags_test); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_floor); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_fma); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_fmma); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_fmms); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_fmod); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_fmodquo); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_fms); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_frac); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_free_cache); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_free_cache2); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_free_pool); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_frexp); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_gamma); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_gamma_inc); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_d); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_d_2exp); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_default_prec); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_default_rounding_mode); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_emax); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_emax_max); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_emax_min); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_emin); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_emin_max); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_emin_min); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_exp); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_patches); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_prec); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_si); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_str); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_ui); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_version); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_z); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_get_z_2exp); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_greater_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_greaterequal_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_hypot); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_inexflag_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_inf_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_init); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_init2); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_initialized_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_inits); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_inits2); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_integer_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_j0); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_j1); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_jn); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_less_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_lessequal_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_lessgreater_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_lgamma); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_li2); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_lngamma); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_log); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_log10); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_log1p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_log2); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_log_ui); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_max); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_min); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_min_prec); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_modf); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_mp_memory_cleanup); + Py_VISIT(traverse_module_state->__pyx_kp_u_mpfr_mp_memory_cleanup_returned); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_mul); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_nan_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_nanflag_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_neg); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_nextabove); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_nextbelow); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_nexttoward); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_number_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_overflow_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_pow); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_prec_round); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_print_rnd_mode); + Py_VISIT(traverse_module_state->__pyx_kp_s_mpfr_pyx); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_rec_sqrt); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_regular_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_remainder); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_remquo); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_rint); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_rint_ceil); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_rint_floor); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_rint_round); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_rint_roundeven); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_rint_trunc); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_root); + Py_VISIT(traverse_module_state->__pyx_kp_u_mpfr_root_is_deprecated_Use_mpfr); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_root_no_warn); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_rootn_ui); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_round); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_roundeven); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_sec); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_sech); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_d); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_default_prec); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_default_rounding_mode); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_divby0); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_emax); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_emin); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_erangeflag); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_exp); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_inexflag); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_inf); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_nan); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_nanflag); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_overflow); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_prec); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_si); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_si_2exp); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_str); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_ui); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_ui_2exp); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_underflow); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_z); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_z_2exp); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_set_zero); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_setsign); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_sgn); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_signbit); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_sin); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_sin_cos); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_sinh); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_sinh_cosh); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_sqr); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_sqrt); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_strtofr); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_sub); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_subnormalize); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_sum); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_swap); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_tan); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_tanh); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_trunc); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_underflow_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_unordered_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_y0); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_y1); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_yn); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_zero_p); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_zeta); + Py_VISIT(traverse_module_state->__pyx_n_s_mpfr_zeta_ui); + Py_VISIT(traverse_module_state->__pyx_n_s_mpz_get_str); + Py_VISIT(traverse_module_state->__pyx_n_s_mpz_set_str); + Py_VISIT(traverse_module_state->__pyx_n_s_n); + Py_VISIT(traverse_module_state->__pyx_kp_u_n_should_be_either_0_or_at_least); + Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_kp_u_new_exponent_for_emin_is_outside); + Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non); + Py_VISIT(traverse_module_state->__pyx_n_s_op); + Py_VISIT(traverse_module_state->__pyx_n_s_op1); + Py_VISIT(traverse_module_state->__pyx_n_s_op2); + Py_VISIT(traverse_module_state->__pyx_n_s_op3); + Py_VISIT(traverse_module_state->__pyx_n_s_op4); + Py_VISIT(traverse_module_state->__pyx_n_s_output); + Py_VISIT(traverse_module_state->__pyx_n_s_output_as_bytes); + Py_VISIT(traverse_module_state->__pyx_n_s_patches); + Py_VISIT(traverse_module_state->__pyx_n_s_patchlevel); + Py_VISIT(traverse_module_state->__pyx_n_s_pointers); + Py_VISIT(traverse_module_state->__pyx_n_s_prec); + Py_VISIT(traverse_module_state->__pyx_kp_u_precision_should_be_between_and); + Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state); + Py_VISIT(traverse_module_state->__pyx_n_s_quotient); + Py_VISIT(traverse_module_state->__pyx_n_s_r); + Py_VISIT(traverse_module_state->__pyx_n_s_range); + Py_VISIT(traverse_module_state->__pyx_n_s_rc); + Py_VISIT(traverse_module_state->__pyx_n_s_reduce); + Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex); + Py_VISIT(traverse_module_state->__pyx_n_s_rnd); + Py_VISIT(traverse_module_state->__pyx_n_s_rnd1); + Py_VISIT(traverse_module_state->__pyx_n_s_rnd2); + Py_VISIT(traverse_module_state->__pyx_n_s_rop); + Py_VISIT(traverse_module_state->__pyx_n_s_rounding_mode); + Py_VISIT(traverse_module_state->__pyx_n_s_rv); + Py_VISIT(traverse_module_state->__pyx_n_s_s); + Py_VISIT(traverse_module_state->__pyx_n_s_self); + Py_VISIT(traverse_module_state->__pyx_kp_s_self__value_cannot_be_converted); + Py_VISIT(traverse_module_state->__pyx_n_s_setstate); + Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython); + Py_VISIT(traverse_module_state->__pyx_n_s_sign); + Py_VISIT(traverse_module_state->__pyx_n_s_signp); + Py_VISIT(traverse_module_state->__pyx_n_s_sop); + Py_VISIT(traverse_module_state->__pyx_n_s_spec); + Py_VISIT(traverse_module_state->__pyx_n_s_split); + Py_VISIT(traverse_module_state->__pyx_n_s_startptr); + Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource); + Py_VISIT(traverse_module_state->__pyx_n_s_sys); + Py_VISIT(traverse_module_state->__pyx_n_s_t); + Py_VISIT(traverse_module_state->__pyx_n_s_tab); + Py_VISIT(traverse_module_state->__pyx_n_s_template); + Py_VISIT(traverse_module_state->__pyx_n_s_template_bytes); + Py_VISIT(traverse_module_state->__pyx_n_s_ternary); + Py_VISIT(traverse_module_state->__pyx_n_s_ternary_pair); + Py_VISIT(traverse_module_state->__pyx_n_s_test); + Py_VISIT(traverse_module_state->__pyx_n_s_thresholds); + Py_VISIT(traverse_module_state->__pyx_n_s_version); + Py_VISIT(traverse_module_state->__pyx_n_s_version_info); + Py_VISIT(traverse_module_state->__pyx_n_s_warn); + Py_VISIT(traverse_module_state->__pyx_n_s_warnings); + Py_VISIT(traverse_module_state->__pyx_n_s_way); + Py_VISIT(traverse_module_state->__pyx_n_s_x); + Py_VISIT(traverse_module_state->__pyx_n_s_y); + Py_VISIT(traverse_module_state->__pyx_int_3); + Py_VISIT(traverse_module_state->__pyx_tuple_); + Py_VISIT(traverse_module_state->__pyx_tuple__2); + Py_VISIT(traverse_module_state->__pyx_tuple__3); + Py_VISIT(traverse_module_state->__pyx_tuple__4); + Py_VISIT(traverse_module_state->__pyx_tuple__5); + Py_VISIT(traverse_module_state->__pyx_tuple__6); + Py_VISIT(traverse_module_state->__pyx_tuple__7); + Py_VISIT(traverse_module_state->__pyx_tuple__8); + Py_VISIT(traverse_module_state->__pyx_tuple__9); + Py_VISIT(traverse_module_state->__pyx_tuple__10); + Py_VISIT(traverse_module_state->__pyx_tuple__11); + Py_VISIT(traverse_module_state->__pyx_tuple__13); + Py_VISIT(traverse_module_state->__pyx_tuple__15); + Py_VISIT(traverse_module_state->__pyx_tuple__17); + Py_VISIT(traverse_module_state->__pyx_tuple__19); + Py_VISIT(traverse_module_state->__pyx_tuple__23); + Py_VISIT(traverse_module_state->__pyx_tuple__25); + Py_VISIT(traverse_module_state->__pyx_tuple__27); + Py_VISIT(traverse_module_state->__pyx_tuple__29); + Py_VISIT(traverse_module_state->__pyx_tuple__31); + Py_VISIT(traverse_module_state->__pyx_tuple__35); + Py_VISIT(traverse_module_state->__pyx_tuple__40); + Py_VISIT(traverse_module_state->__pyx_tuple__46); + Py_VISIT(traverse_module_state->__pyx_tuple__50); + Py_VISIT(traverse_module_state->__pyx_tuple__52); + Py_VISIT(traverse_module_state->__pyx_tuple__55); + Py_VISIT(traverse_module_state->__pyx_tuple__58); + Py_VISIT(traverse_module_state->__pyx_tuple__60); + Py_VISIT(traverse_module_state->__pyx_tuple__64); + Py_VISIT(traverse_module_state->__pyx_tuple__66); + Py_VISIT(traverse_module_state->__pyx_tuple__68); + Py_VISIT(traverse_module_state->__pyx_tuple__71); + Py_VISIT(traverse_module_state->__pyx_tuple__73); + Py_VISIT(traverse_module_state->__pyx_tuple__76); + Py_VISIT(traverse_module_state->__pyx_tuple__85); + Py_VISIT(traverse_module_state->__pyx_tuple__93); + Py_VISIT(traverse_module_state->__pyx_tuple__121); + Py_VISIT(traverse_module_state->__pyx_tuple__129); + Py_VISIT(traverse_module_state->__pyx_tuple__145); + Py_VISIT(traverse_module_state->__pyx_tuple__148); + Py_VISIT(traverse_module_state->__pyx_tuple__158); + Py_VISIT(traverse_module_state->__pyx_tuple__163); + Py_VISIT(traverse_module_state->__pyx_tuple__166); + Py_VISIT(traverse_module_state->__pyx_tuple__170); + Py_VISIT(traverse_module_state->__pyx_tuple__173); + Py_VISIT(traverse_module_state->__pyx_tuple__179); + Py_VISIT(traverse_module_state->__pyx_tuple__182); + Py_VISIT(traverse_module_state->__pyx_tuple__184); + Py_VISIT(traverse_module_state->__pyx_tuple__186); + Py_VISIT(traverse_module_state->__pyx_tuple__189); + Py_VISIT(traverse_module_state->__pyx_tuple__201); + Py_VISIT(traverse_module_state->__pyx_tuple__203); + Py_VISIT(traverse_module_state->__pyx_tuple__205); + Py_VISIT(traverse_module_state->__pyx_tuple__210); + Py_VISIT(traverse_module_state->__pyx_tuple__213); + Py_VISIT(traverse_module_state->__pyx_tuple__215); + Py_VISIT(traverse_module_state->__pyx_tuple__218); + Py_VISIT(traverse_module_state->__pyx_tuple__226); + Py_VISIT(traverse_module_state->__pyx_tuple__229); + Py_VISIT(traverse_module_state->__pyx_tuple__232); + Py_VISIT(traverse_module_state->__pyx_tuple__234); + Py_VISIT(traverse_module_state->__pyx_tuple__236); + Py_VISIT(traverse_module_state->__pyx_tuple__243); + Py_VISIT(traverse_module_state->__pyx_tuple__247); + Py_VISIT(traverse_module_state->__pyx_tuple__254); + Py_VISIT(traverse_module_state->__pyx_tuple__276); + Py_VISIT(traverse_module_state->__pyx_tuple__281); + Py_VISIT(traverse_module_state->__pyx_codeobj__14); + Py_VISIT(traverse_module_state->__pyx_codeobj__16); + Py_VISIT(traverse_module_state->__pyx_codeobj__18); + Py_VISIT(traverse_module_state->__pyx_codeobj__20); + Py_VISIT(traverse_module_state->__pyx_codeobj__21); + Py_VISIT(traverse_module_state->__pyx_codeobj__22); + Py_VISIT(traverse_module_state->__pyx_codeobj__24); + Py_VISIT(traverse_module_state->__pyx_codeobj__26); + Py_VISIT(traverse_module_state->__pyx_codeobj__28); + Py_VISIT(traverse_module_state->__pyx_codeobj__30); + Py_VISIT(traverse_module_state->__pyx_codeobj__32); + Py_VISIT(traverse_module_state->__pyx_codeobj__33); + Py_VISIT(traverse_module_state->__pyx_codeobj__34); + Py_VISIT(traverse_module_state->__pyx_codeobj__36); + Py_VISIT(traverse_module_state->__pyx_codeobj__37); + Py_VISIT(traverse_module_state->__pyx_codeobj__38); + Py_VISIT(traverse_module_state->__pyx_codeobj__39); + Py_VISIT(traverse_module_state->__pyx_codeobj__41); + Py_VISIT(traverse_module_state->__pyx_codeobj__42); + Py_VISIT(traverse_module_state->__pyx_codeobj__43); + Py_VISIT(traverse_module_state->__pyx_codeobj__44); + Py_VISIT(traverse_module_state->__pyx_codeobj__45); + Py_VISIT(traverse_module_state->__pyx_codeobj__47); + Py_VISIT(traverse_module_state->__pyx_codeobj__48); + Py_VISIT(traverse_module_state->__pyx_codeobj__49); + Py_VISIT(traverse_module_state->__pyx_codeobj__51); + Py_VISIT(traverse_module_state->__pyx_codeobj__53); + Py_VISIT(traverse_module_state->__pyx_codeobj__54); + Py_VISIT(traverse_module_state->__pyx_codeobj__56); + Py_VISIT(traverse_module_state->__pyx_codeobj__57); + Py_VISIT(traverse_module_state->__pyx_codeobj__59); + Py_VISIT(traverse_module_state->__pyx_codeobj__61); + Py_VISIT(traverse_module_state->__pyx_codeobj__62); + Py_VISIT(traverse_module_state->__pyx_codeobj__63); + Py_VISIT(traverse_module_state->__pyx_codeobj__65); + Py_VISIT(traverse_module_state->__pyx_codeobj__67); + Py_VISIT(traverse_module_state->__pyx_codeobj__69); + Py_VISIT(traverse_module_state->__pyx_codeobj__70); + Py_VISIT(traverse_module_state->__pyx_codeobj__72); + Py_VISIT(traverse_module_state->__pyx_codeobj__74); + Py_VISIT(traverse_module_state->__pyx_codeobj__75); + Py_VISIT(traverse_module_state->__pyx_codeobj__77); + Py_VISIT(traverse_module_state->__pyx_codeobj__78); + Py_VISIT(traverse_module_state->__pyx_codeobj__79); + Py_VISIT(traverse_module_state->__pyx_codeobj__80); + Py_VISIT(traverse_module_state->__pyx_codeobj__81); + Py_VISIT(traverse_module_state->__pyx_codeobj__82); + Py_VISIT(traverse_module_state->__pyx_codeobj__83); + Py_VISIT(traverse_module_state->__pyx_codeobj__84); + Py_VISIT(traverse_module_state->__pyx_codeobj__86); + Py_VISIT(traverse_module_state->__pyx_codeobj__87); + Py_VISIT(traverse_module_state->__pyx_codeobj__88); + Py_VISIT(traverse_module_state->__pyx_codeobj__89); + Py_VISIT(traverse_module_state->__pyx_codeobj__90); + Py_VISIT(traverse_module_state->__pyx_codeobj__91); + Py_VISIT(traverse_module_state->__pyx_codeobj__92); + Py_VISIT(traverse_module_state->__pyx_codeobj__94); + Py_VISIT(traverse_module_state->__pyx_codeobj__95); + Py_VISIT(traverse_module_state->__pyx_codeobj__96); + Py_VISIT(traverse_module_state->__pyx_codeobj__97); + Py_VISIT(traverse_module_state->__pyx_codeobj__98); + Py_VISIT(traverse_module_state->__pyx_codeobj__99); + Py_VISIT(traverse_module_state->__pyx_codeobj__100); + Py_VISIT(traverse_module_state->__pyx_codeobj__101); + Py_VISIT(traverse_module_state->__pyx_codeobj__102); + Py_VISIT(traverse_module_state->__pyx_codeobj__103); + Py_VISIT(traverse_module_state->__pyx_codeobj__104); + Py_VISIT(traverse_module_state->__pyx_codeobj__105); + Py_VISIT(traverse_module_state->__pyx_codeobj__106); + Py_VISIT(traverse_module_state->__pyx_codeobj__107); + Py_VISIT(traverse_module_state->__pyx_codeobj__108); + Py_VISIT(traverse_module_state->__pyx_codeobj__109); + Py_VISIT(traverse_module_state->__pyx_codeobj__110); + Py_VISIT(traverse_module_state->__pyx_codeobj__111); + Py_VISIT(traverse_module_state->__pyx_codeobj__112); + Py_VISIT(traverse_module_state->__pyx_codeobj__113); + Py_VISIT(traverse_module_state->__pyx_codeobj__114); + Py_VISIT(traverse_module_state->__pyx_codeobj__115); + Py_VISIT(traverse_module_state->__pyx_codeobj__116); + Py_VISIT(traverse_module_state->__pyx_codeobj__117); + Py_VISIT(traverse_module_state->__pyx_codeobj__118); + Py_VISIT(traverse_module_state->__pyx_codeobj__119); + Py_VISIT(traverse_module_state->__pyx_codeobj__120); + Py_VISIT(traverse_module_state->__pyx_codeobj__122); + Py_VISIT(traverse_module_state->__pyx_codeobj__123); + Py_VISIT(traverse_module_state->__pyx_codeobj__124); + Py_VISIT(traverse_module_state->__pyx_codeobj__125); + Py_VISIT(traverse_module_state->__pyx_codeobj__126); + Py_VISIT(traverse_module_state->__pyx_codeobj__127); + Py_VISIT(traverse_module_state->__pyx_codeobj__128); + Py_VISIT(traverse_module_state->__pyx_codeobj__130); + Py_VISIT(traverse_module_state->__pyx_codeobj__131); + Py_VISIT(traverse_module_state->__pyx_codeobj__132); + Py_VISIT(traverse_module_state->__pyx_codeobj__133); + Py_VISIT(traverse_module_state->__pyx_codeobj__134); + Py_VISIT(traverse_module_state->__pyx_codeobj__135); + Py_VISIT(traverse_module_state->__pyx_codeobj__136); + Py_VISIT(traverse_module_state->__pyx_codeobj__137); + Py_VISIT(traverse_module_state->__pyx_codeobj__138); + Py_VISIT(traverse_module_state->__pyx_codeobj__139); + Py_VISIT(traverse_module_state->__pyx_codeobj__140); + Py_VISIT(traverse_module_state->__pyx_codeobj__141); + Py_VISIT(traverse_module_state->__pyx_codeobj__142); + Py_VISIT(traverse_module_state->__pyx_codeobj__143); + Py_VISIT(traverse_module_state->__pyx_codeobj__144); + Py_VISIT(traverse_module_state->__pyx_codeobj__146); + Py_VISIT(traverse_module_state->__pyx_codeobj__147); + Py_VISIT(traverse_module_state->__pyx_codeobj__149); + Py_VISIT(traverse_module_state->__pyx_codeobj__150); + Py_VISIT(traverse_module_state->__pyx_codeobj__151); + Py_VISIT(traverse_module_state->__pyx_codeobj__152); + Py_VISIT(traverse_module_state->__pyx_codeobj__153); + Py_VISIT(traverse_module_state->__pyx_codeobj__154); + Py_VISIT(traverse_module_state->__pyx_codeobj__155); + Py_VISIT(traverse_module_state->__pyx_codeobj__156); + Py_VISIT(traverse_module_state->__pyx_codeobj__157); + Py_VISIT(traverse_module_state->__pyx_codeobj__159); + Py_VISIT(traverse_module_state->__pyx_codeobj__160); + Py_VISIT(traverse_module_state->__pyx_codeobj__161); + Py_VISIT(traverse_module_state->__pyx_codeobj__162); + Py_VISIT(traverse_module_state->__pyx_codeobj__164); + Py_VISIT(traverse_module_state->__pyx_codeobj__165); + Py_VISIT(traverse_module_state->__pyx_codeobj__167); + Py_VISIT(traverse_module_state->__pyx_codeobj__168); + Py_VISIT(traverse_module_state->__pyx_codeobj__169); + Py_VISIT(traverse_module_state->__pyx_codeobj__171); + Py_VISIT(traverse_module_state->__pyx_codeobj__172); + Py_VISIT(traverse_module_state->__pyx_codeobj__174); + Py_VISIT(traverse_module_state->__pyx_codeobj__175); + Py_VISIT(traverse_module_state->__pyx_codeobj__176); + Py_VISIT(traverse_module_state->__pyx_codeobj__177); + Py_VISIT(traverse_module_state->__pyx_codeobj__178); + Py_VISIT(traverse_module_state->__pyx_codeobj__180); + Py_VISIT(traverse_module_state->__pyx_codeobj__181); + Py_VISIT(traverse_module_state->__pyx_codeobj__183); + Py_VISIT(traverse_module_state->__pyx_codeobj__185); + Py_VISIT(traverse_module_state->__pyx_codeobj__187); + Py_VISIT(traverse_module_state->__pyx_codeobj__188); + Py_VISIT(traverse_module_state->__pyx_codeobj__190); + Py_VISIT(traverse_module_state->__pyx_codeobj__191); + Py_VISIT(traverse_module_state->__pyx_codeobj__192); + Py_VISIT(traverse_module_state->__pyx_codeobj__193); + Py_VISIT(traverse_module_state->__pyx_codeobj__194); + Py_VISIT(traverse_module_state->__pyx_codeobj__195); + Py_VISIT(traverse_module_state->__pyx_codeobj__196); + Py_VISIT(traverse_module_state->__pyx_codeobj__197); + Py_VISIT(traverse_module_state->__pyx_codeobj__198); + Py_VISIT(traverse_module_state->__pyx_codeobj__199); + Py_VISIT(traverse_module_state->__pyx_codeobj__200); + Py_VISIT(traverse_module_state->__pyx_codeobj__202); + Py_VISIT(traverse_module_state->__pyx_codeobj__204); + Py_VISIT(traverse_module_state->__pyx_codeobj__206); + Py_VISIT(traverse_module_state->__pyx_codeobj__207); + Py_VISIT(traverse_module_state->__pyx_codeobj__208); + Py_VISIT(traverse_module_state->__pyx_codeobj__209); + Py_VISIT(traverse_module_state->__pyx_codeobj__211); + Py_VISIT(traverse_module_state->__pyx_codeobj__212); + Py_VISIT(traverse_module_state->__pyx_codeobj__214); + Py_VISIT(traverse_module_state->__pyx_codeobj__216); + Py_VISIT(traverse_module_state->__pyx_codeobj__217); + Py_VISIT(traverse_module_state->__pyx_codeobj__219); + Py_VISIT(traverse_module_state->__pyx_codeobj__220); + Py_VISIT(traverse_module_state->__pyx_codeobj__221); + Py_VISIT(traverse_module_state->__pyx_codeobj__222); + Py_VISIT(traverse_module_state->__pyx_codeobj__223); + Py_VISIT(traverse_module_state->__pyx_codeobj__224); + Py_VISIT(traverse_module_state->__pyx_codeobj__225); + Py_VISIT(traverse_module_state->__pyx_codeobj__227); + Py_VISIT(traverse_module_state->__pyx_codeobj__228); + Py_VISIT(traverse_module_state->__pyx_codeobj__230); + Py_VISIT(traverse_module_state->__pyx_codeobj__231); + Py_VISIT(traverse_module_state->__pyx_codeobj__233); + Py_VISIT(traverse_module_state->__pyx_codeobj__235); + Py_VISIT(traverse_module_state->__pyx_codeobj__237); + Py_VISIT(traverse_module_state->__pyx_codeobj__238); + Py_VISIT(traverse_module_state->__pyx_codeobj__239); + Py_VISIT(traverse_module_state->__pyx_codeobj__240); + Py_VISIT(traverse_module_state->__pyx_codeobj__241); + Py_VISIT(traverse_module_state->__pyx_codeobj__242); + Py_VISIT(traverse_module_state->__pyx_codeobj__244); + Py_VISIT(traverse_module_state->__pyx_codeobj__245); + Py_VISIT(traverse_module_state->__pyx_codeobj__246); + Py_VISIT(traverse_module_state->__pyx_codeobj__248); + Py_VISIT(traverse_module_state->__pyx_codeobj__249); + Py_VISIT(traverse_module_state->__pyx_codeobj__250); + Py_VISIT(traverse_module_state->__pyx_codeobj__251); + Py_VISIT(traverse_module_state->__pyx_codeobj__252); + Py_VISIT(traverse_module_state->__pyx_codeobj__253); + Py_VISIT(traverse_module_state->__pyx_codeobj__255); + Py_VISIT(traverse_module_state->__pyx_codeobj__256); + Py_VISIT(traverse_module_state->__pyx_codeobj__257); + Py_VISIT(traverse_module_state->__pyx_codeobj__258); + Py_VISIT(traverse_module_state->__pyx_codeobj__259); + Py_VISIT(traverse_module_state->__pyx_codeobj__260); + Py_VISIT(traverse_module_state->__pyx_codeobj__261); + Py_VISIT(traverse_module_state->__pyx_codeobj__262); + Py_VISIT(traverse_module_state->__pyx_codeobj__263); + Py_VISIT(traverse_module_state->__pyx_codeobj__264); + Py_VISIT(traverse_module_state->__pyx_codeobj__265); + Py_VISIT(traverse_module_state->__pyx_codeobj__266); + Py_VISIT(traverse_module_state->__pyx_codeobj__267); + Py_VISIT(traverse_module_state->__pyx_codeobj__268); + Py_VISIT(traverse_module_state->__pyx_codeobj__269); + Py_VISIT(traverse_module_state->__pyx_codeobj__270); + Py_VISIT(traverse_module_state->__pyx_codeobj__271); + Py_VISIT(traverse_module_state->__pyx_codeobj__272); + Py_VISIT(traverse_module_state->__pyx_codeobj__273); + Py_VISIT(traverse_module_state->__pyx_codeobj__274); + Py_VISIT(traverse_module_state->__pyx_codeobj__275); + Py_VISIT(traverse_module_state->__pyx_codeobj__277); + Py_VISIT(traverse_module_state->__pyx_codeobj__278); + Py_VISIT(traverse_module_state->__pyx_codeobj__279); + Py_VISIT(traverse_module_state->__pyx_codeobj__280); + Py_VISIT(traverse_module_state->__pyx_codeobj__282); + return 0; +} +#endif +/* #### Code section: module_state_defines ### */ +#define __pyx_d __pyx_mstate_global->__pyx_d +#define __pyx_b __pyx_mstate_global->__pyx_b +#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime +#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple +#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes +#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode +#ifdef __Pyx_CyFunction_USED +#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType +#endif +#ifdef __Pyx_FusedFunction_USED +#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType +#endif +#ifdef __Pyx_Generator_USED +#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType +#endif +#ifdef __Pyx_IterableCoroutine_USED +#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType +#endif +#ifdef __Pyx_Coroutine_USED +#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#endif +#if CYTHON_USE_MODULE_STATE +#define __pyx_type_4mpfr_Mpz_t __pyx_mstate_global->__pyx_type_4mpfr_Mpz_t +#define __pyx_type_4mpfr_Mpfr_t __pyx_mstate_global->__pyx_type_4mpfr_Mpfr_t +#endif +#define __pyx_ptype_4mpfr_Mpz_t __pyx_mstate_global->__pyx_ptype_4mpfr_Mpz_t +#define __pyx_ptype_4mpfr_Mpfr_t __pyx_mstate_global->__pyx_ptype_4mpfr_Mpfr_t +#define __pyx_kp_u_Base_must_satisfy_2_base_62_or_2 __pyx_mstate_global->__pyx_kp_u_Base_must_satisfy_2_base_62_or_2 +#define __pyx_kp_u_Cannot_convert_None_to_mpfr_Mpfr __pyx_mstate_global->__pyx_kp_u_Cannot_convert_None_to_mpfr_Mpfr +#define __pyx_n_s_DeprecationWarning __pyx_mstate_global->__pyx_n_s_DeprecationWarning +#define __pyx_kp_u_Error_during_string_conversion __pyx_mstate_global->__pyx_kp_u_Error_during_string_conversion +#define __pyx_n_s_LONG_MAX __pyx_mstate_global->__pyx_n_s_LONG_MAX +#define __pyx_n_s_LONG_MIN __pyx_mstate_global->__pyx_n_s_LONG_MIN +#define __pyx_n_s_MPFR_EMAX_DEFAULT __pyx_mstate_global->__pyx_n_s_MPFR_EMAX_DEFAULT +#define __pyx_n_s_MPFR_EMIN_DEFAULT __pyx_mstate_global->__pyx_n_s_MPFR_EMIN_DEFAULT +#define __pyx_n_s_MPFR_FLAGS_ALL __pyx_mstate_global->__pyx_n_s_MPFR_FLAGS_ALL +#define __pyx_n_s_MPFR_FLAGS_DIVBY0 __pyx_mstate_global->__pyx_n_s_MPFR_FLAGS_DIVBY0 +#define __pyx_n_s_MPFR_FLAGS_ERANGE __pyx_mstate_global->__pyx_n_s_MPFR_FLAGS_ERANGE +#define __pyx_n_s_MPFR_FLAGS_INEXACT __pyx_mstate_global->__pyx_n_s_MPFR_FLAGS_INEXACT +#define __pyx_n_s_MPFR_FLAGS_NAN __pyx_mstate_global->__pyx_n_s_MPFR_FLAGS_NAN +#define __pyx_n_s_MPFR_FLAGS_OVERFLOW __pyx_mstate_global->__pyx_n_s_MPFR_FLAGS_OVERFLOW +#define __pyx_n_s_MPFR_FLAGS_UNDERFLOW __pyx_mstate_global->__pyx_n_s_MPFR_FLAGS_UNDERFLOW +#define __pyx_n_s_MPFR_FREE_GLOBAL_CACHE __pyx_mstate_global->__pyx_n_s_MPFR_FREE_GLOBAL_CACHE +#define __pyx_n_s_MPFR_FREE_LOCAL_CACHE __pyx_mstate_global->__pyx_n_s_MPFR_FREE_LOCAL_CACHE +#define __pyx_n_s_MPFR_PREC_MAX __pyx_mstate_global->__pyx_n_s_MPFR_PREC_MAX +#define __pyx_n_s_MPFR_PREC_MIN __pyx_mstate_global->__pyx_n_s_MPFR_PREC_MIN +#define __pyx_n_s_MPFR_RNDA __pyx_mstate_global->__pyx_n_s_MPFR_RNDA +#define __pyx_n_s_MPFR_RNDD __pyx_mstate_global->__pyx_n_s_MPFR_RNDD +#define __pyx_n_s_MPFR_RNDF __pyx_mstate_global->__pyx_n_s_MPFR_RNDF +#define __pyx_n_s_MPFR_RNDN __pyx_mstate_global->__pyx_n_s_MPFR_RNDN +#define __pyx_n_s_MPFR_RNDU __pyx_mstate_global->__pyx_n_s_MPFR_RNDU +#define __pyx_n_s_MPFR_RNDZ __pyx_mstate_global->__pyx_n_s_MPFR_RNDZ +#define __pyx_n_s_MPFR_VERSION __pyx_mstate_global->__pyx_n_s_MPFR_VERSION +#define __pyx_n_s_MPFR_VERSION_MAJOR __pyx_mstate_global->__pyx_n_s_MPFR_VERSION_MAJOR +#define __pyx_n_s_MPFR_VERSION_MINOR __pyx_mstate_global->__pyx_n_s_MPFR_VERSION_MINOR +#define __pyx_n_s_MPFR_VERSION_NUM __pyx_mstate_global->__pyx_n_s_MPFR_VERSION_NUM +#define __pyx_n_s_MPFR_VERSION_PATCHLEVEL __pyx_mstate_global->__pyx_n_s_MPFR_VERSION_PATCHLEVEL +#define __pyx_n_s_MPFR_VERSION_STRING __pyx_mstate_global->__pyx_n_s_MPFR_VERSION_STRING +#define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError +#define __pyx_n_s_Mpfr_t __pyx_mstate_global->__pyx_n_s_Mpfr_t +#define __pyx_n_s_Mpfr_t___reduce_cython __pyx_mstate_global->__pyx_n_s_Mpfr_t___reduce_cython +#define __pyx_n_s_Mpfr_t___setstate_cython __pyx_mstate_global->__pyx_n_s_Mpfr_t___setstate_cython +#define __pyx_kp_u_Mpfr_t_instance_is_already_initi __pyx_mstate_global->__pyx_kp_u_Mpfr_t_instance_is_already_initi +#define __pyx_kp_u_Mpfr_t_instance_should_be_initia __pyx_mstate_global->__pyx_kp_u_Mpfr_t_instance_should_be_initia +#define __pyx_n_s_Mpz_t __pyx_mstate_global->__pyx_n_s_Mpz_t +#define __pyx_n_s_Mpz_t___reduce_cython __pyx_mstate_global->__pyx_n_s_Mpz_t___reduce_cython +#define __pyx_n_s_Mpz_t___setstate_cython __pyx_mstate_global->__pyx_n_s_Mpz_t___setstate_cython +#define __pyx_kp_u_Not_a_valid_number_for_base __pyx_mstate_global->__pyx_kp_u_Not_a_valid_number_for_base +#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError +#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError +#define __pyx_n_s_ULONG_MAX __pyx_mstate_global->__pyx_n_s_ULONG_MAX +#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError +#define __pyx_n_s__12 __pyx_mstate_global->__pyx_n_s__12 +#define __pyx_n_s__283 __pyx_mstate_global->__pyx_n_s__283 +#define __pyx_n_s_arg __pyx_mstate_global->__pyx_n_s_arg +#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args +#define __pyx_n_u_ascii __pyx_mstate_global->__pyx_n_u_ascii +#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines +#define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b +#define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base +#define __pyx_kp_u_base_must_satisfy_2_base_62_or_b __pyx_mstate_global->__pyx_kp_u_base_must_satisfy_2_base_62_or_b +#define __pyx_kp_u_base_should_be_in_the_range_2_to __pyx_mstate_global->__pyx_kp_u_base_should_be_in_the_range_2_to +#define __pyx_kp_u_base_should_be_zero_or_in_the_ra __pyx_mstate_global->__pyx_kp_u_base_should_be_zero_or_in_the_ra +#define __pyx_n_s_bytes_s __pyx_mstate_global->__pyx_n_s_bytes_s +#define __pyx_n_s_c_digits __pyx_mstate_global->__pyx_n_s_c_digits +#define __pyx_n_s_c_digits_alloc __pyx_mstate_global->__pyx_n_s_c_digits_alloc +#define __pyx_n_s_c_digits_len __pyx_mstate_global->__pyx_n_s_c_digits_len +#define __pyx_n_s_category __pyx_mstate_global->__pyx_n_s_category +#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback +#define __pyx_n_s_cop __pyx_mstate_global->__pyx_n_s_cop +#define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d +#define __pyx_n_s_digits __pyx_mstate_global->__pyx_n_s_digits +#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable +#define __pyx_n_s_e __pyx_mstate_global->__pyx_n_s_e +#define __pyx_n_s_elt __pyx_mstate_global->__pyx_n_s_elt +#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable +#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode +#define __pyx_n_s_endindex __pyx_mstate_global->__pyx_n_s_endindex +#define __pyx_n_s_endptr __pyx_mstate_global->__pyx_n_s_endptr +#define __pyx_n_s_err __pyx_mstate_global->__pyx_n_s_err +#define __pyx_n_s_error_code __pyx_mstate_global->__pyx_n_s_error_code +#define __pyx_n_s_exp __pyx_mstate_global->__pyx_n_s_exp +#define __pyx_n_s_exponent __pyx_mstate_global->__pyx_n_s_exponent +#define __pyx_kp_u_exponent_not_in_current_exponent __pyx_mstate_global->__pyx_kp_u_exponent_not_in_current_exponent +#define __pyx_kp_u_flag_mask_contains_invalid_flags __pyx_mstate_global->__pyx_kp_u_flag_mask_contains_invalid_flags +#define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags +#define __pyx_n_s_fop __pyx_mstate_global->__pyx_n_s_fop +#define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format +#define __pyx_n_s_freefunc __pyx_mstate_global->__pyx_n_s_freefunc +#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc +#define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate +#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i +#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import +#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing +#define __pyx_kp_u_invalid_flag_mask __pyx_mstate_global->__pyx_kp_u_invalid_flag_mask +#define __pyx_kp_u_invalid_rounding_mode __pyx_mstate_global->__pyx_kp_u_invalid_rounding_mode +#define __pyx_n_s_iop __pyx_mstate_global->__pyx_n_s_iop +#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine +#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled +#define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k +#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main +#define __pyx_n_s_major __pyx_mstate_global->__pyx_n_s_major +#define __pyx_n_s_mask __pyx_mstate_global->__pyx_n_s_mask +#define __pyx_n_s_minor __pyx_mstate_global->__pyx_n_s_minor +#define __pyx_n_s_mpfr __pyx_mstate_global->__pyx_n_s_mpfr +#define __pyx_n_s_mpfr_abs __pyx_mstate_global->__pyx_n_s_mpfr_abs +#define __pyx_n_s_mpfr_acos __pyx_mstate_global->__pyx_n_s_mpfr_acos +#define __pyx_n_s_mpfr_acosh __pyx_mstate_global->__pyx_n_s_mpfr_acosh +#define __pyx_n_s_mpfr_add __pyx_mstate_global->__pyx_n_s_mpfr_add +#define __pyx_n_s_mpfr_agm __pyx_mstate_global->__pyx_n_s_mpfr_agm +#define __pyx_n_s_mpfr_ai __pyx_mstate_global->__pyx_n_s_mpfr_ai +#define __pyx_n_s_mpfr_asin __pyx_mstate_global->__pyx_n_s_mpfr_asin +#define __pyx_n_s_mpfr_asinh __pyx_mstate_global->__pyx_n_s_mpfr_asinh +#define __pyx_n_s_mpfr_asprintf __pyx_mstate_global->__pyx_n_s_mpfr_asprintf +#define __pyx_n_s_mpfr_atan __pyx_mstate_global->__pyx_n_s_mpfr_atan +#define __pyx_n_s_mpfr_atan2 __pyx_mstate_global->__pyx_n_s_mpfr_atan2 +#define __pyx_n_s_mpfr_atanh __pyx_mstate_global->__pyx_n_s_mpfr_atanh +#define __pyx_n_s_mpfr_beta __pyx_mstate_global->__pyx_n_s_mpfr_beta +#define __pyx_n_s_mpfr_buildopt_decimal_p __pyx_mstate_global->__pyx_n_s_mpfr_buildopt_decimal_p +#define __pyx_n_s_mpfr_buildopt_float128_p __pyx_mstate_global->__pyx_n_s_mpfr_buildopt_float128_p +#define __pyx_n_s_mpfr_buildopt_gmpinternals_p __pyx_mstate_global->__pyx_n_s_mpfr_buildopt_gmpinternals_p +#define __pyx_n_s_mpfr_buildopt_sharedcache_p __pyx_mstate_global->__pyx_n_s_mpfr_buildopt_sharedcache_p +#define __pyx_n_s_mpfr_buildopt_tls_p __pyx_mstate_global->__pyx_n_s_mpfr_buildopt_tls_p +#define __pyx_n_s_mpfr_buildopt_tune_case __pyx_mstate_global->__pyx_n_s_mpfr_buildopt_tune_case +#define __pyx_n_s_mpfr_can_round __pyx_mstate_global->__pyx_n_s_mpfr_can_round +#define __pyx_n_s_mpfr_cbrt __pyx_mstate_global->__pyx_n_s_mpfr_cbrt +#define __pyx_n_s_mpfr_ceil __pyx_mstate_global->__pyx_n_s_mpfr_ceil +#define __pyx_n_s_mpfr_check_range __pyx_mstate_global->__pyx_n_s_mpfr_check_range +#define __pyx_n_s_mpfr_clear __pyx_mstate_global->__pyx_n_s_mpfr_clear +#define __pyx_n_s_mpfr_clear_divby0 __pyx_mstate_global->__pyx_n_s_mpfr_clear_divby0 +#define __pyx_n_s_mpfr_clear_erangeflag __pyx_mstate_global->__pyx_n_s_mpfr_clear_erangeflag +#define __pyx_n_s_mpfr_clear_flags __pyx_mstate_global->__pyx_n_s_mpfr_clear_flags +#define __pyx_n_s_mpfr_clear_inexflag __pyx_mstate_global->__pyx_n_s_mpfr_clear_inexflag +#define __pyx_n_s_mpfr_clear_nanflag __pyx_mstate_global->__pyx_n_s_mpfr_clear_nanflag +#define __pyx_n_s_mpfr_clear_overflow __pyx_mstate_global->__pyx_n_s_mpfr_clear_overflow +#define __pyx_n_s_mpfr_clear_underflow __pyx_mstate_global->__pyx_n_s_mpfr_clear_underflow +#define __pyx_n_s_mpfr_clears __pyx_mstate_global->__pyx_n_s_mpfr_clears +#define __pyx_n_s_mpfr_cmp __pyx_mstate_global->__pyx_n_s_mpfr_cmp +#define __pyx_n_s_mpfr_cmpabs __pyx_mstate_global->__pyx_n_s_mpfr_cmpabs +#define __pyx_n_s_mpfr_const_catalan __pyx_mstate_global->__pyx_n_s_mpfr_const_catalan +#define __pyx_n_s_mpfr_const_euler __pyx_mstate_global->__pyx_n_s_mpfr_const_euler +#define __pyx_n_s_mpfr_const_log2 __pyx_mstate_global->__pyx_n_s_mpfr_const_log2 +#define __pyx_n_s_mpfr_const_pi __pyx_mstate_global->__pyx_n_s_mpfr_const_pi +#define __pyx_n_s_mpfr_copysign __pyx_mstate_global->__pyx_n_s_mpfr_copysign +#define __pyx_n_s_mpfr_cos __pyx_mstate_global->__pyx_n_s_mpfr_cos +#define __pyx_n_s_mpfr_cosh __pyx_mstate_global->__pyx_n_s_mpfr_cosh +#define __pyx_n_s_mpfr_cot __pyx_mstate_global->__pyx_n_s_mpfr_cot +#define __pyx_n_s_mpfr_coth __pyx_mstate_global->__pyx_n_s_mpfr_coth +#define __pyx_n_s_mpfr_csc __pyx_mstate_global->__pyx_n_s_mpfr_csc +#define __pyx_n_s_mpfr_csch __pyx_mstate_global->__pyx_n_s_mpfr_csch +#define __pyx_n_s_mpfr_digamma __pyx_mstate_global->__pyx_n_s_mpfr_digamma +#define __pyx_n_s_mpfr_dim __pyx_mstate_global->__pyx_n_s_mpfr_dim +#define __pyx_n_s_mpfr_div __pyx_mstate_global->__pyx_n_s_mpfr_div +#define __pyx_n_s_mpfr_divby0_p __pyx_mstate_global->__pyx_n_s_mpfr_divby0_p +#define __pyx_n_s_mpfr_eint __pyx_mstate_global->__pyx_n_s_mpfr_eint +#define __pyx_n_s_mpfr_equal_p __pyx_mstate_global->__pyx_n_s_mpfr_equal_p +#define __pyx_n_s_mpfr_erangeflag_p __pyx_mstate_global->__pyx_n_s_mpfr_erangeflag_p +#define __pyx_n_s_mpfr_erf __pyx_mstate_global->__pyx_n_s_mpfr_erf +#define __pyx_n_s_mpfr_erfc __pyx_mstate_global->__pyx_n_s_mpfr_erfc +#define __pyx_n_s_mpfr_exp __pyx_mstate_global->__pyx_n_s_mpfr_exp +#define __pyx_n_s_mpfr_exp10 __pyx_mstate_global->__pyx_n_s_mpfr_exp10 +#define __pyx_n_s_mpfr_exp2 __pyx_mstate_global->__pyx_n_s_mpfr_exp2 +#define __pyx_n_s_mpfr_expm1 __pyx_mstate_global->__pyx_n_s_mpfr_expm1 +#define __pyx_n_s_mpfr_fac_ui __pyx_mstate_global->__pyx_n_s_mpfr_fac_ui +#define __pyx_n_s_mpfr_fits_slong_p __pyx_mstate_global->__pyx_n_s_mpfr_fits_slong_p +#define __pyx_n_s_mpfr_fits_ulong_p __pyx_mstate_global->__pyx_n_s_mpfr_fits_ulong_p +#define __pyx_n_s_mpfr_flags_clear __pyx_mstate_global->__pyx_n_s_mpfr_flags_clear +#define __pyx_n_s_mpfr_flags_restore __pyx_mstate_global->__pyx_n_s_mpfr_flags_restore +#define __pyx_n_s_mpfr_flags_save __pyx_mstate_global->__pyx_n_s_mpfr_flags_save +#define __pyx_n_s_mpfr_flags_set __pyx_mstate_global->__pyx_n_s_mpfr_flags_set +#define __pyx_n_s_mpfr_flags_test __pyx_mstate_global->__pyx_n_s_mpfr_flags_test +#define __pyx_n_s_mpfr_floor __pyx_mstate_global->__pyx_n_s_mpfr_floor +#define __pyx_n_s_mpfr_fma __pyx_mstate_global->__pyx_n_s_mpfr_fma +#define __pyx_n_s_mpfr_fmma __pyx_mstate_global->__pyx_n_s_mpfr_fmma +#define __pyx_n_s_mpfr_fmms __pyx_mstate_global->__pyx_n_s_mpfr_fmms +#define __pyx_n_s_mpfr_fmod __pyx_mstate_global->__pyx_n_s_mpfr_fmod +#define __pyx_n_s_mpfr_fmodquo __pyx_mstate_global->__pyx_n_s_mpfr_fmodquo +#define __pyx_n_s_mpfr_fms __pyx_mstate_global->__pyx_n_s_mpfr_fms +#define __pyx_n_s_mpfr_frac __pyx_mstate_global->__pyx_n_s_mpfr_frac +#define __pyx_n_s_mpfr_free_cache __pyx_mstate_global->__pyx_n_s_mpfr_free_cache +#define __pyx_n_s_mpfr_free_cache2 __pyx_mstate_global->__pyx_n_s_mpfr_free_cache2 +#define __pyx_n_s_mpfr_free_pool __pyx_mstate_global->__pyx_n_s_mpfr_free_pool +#define __pyx_n_s_mpfr_frexp __pyx_mstate_global->__pyx_n_s_mpfr_frexp +#define __pyx_n_s_mpfr_gamma __pyx_mstate_global->__pyx_n_s_mpfr_gamma +#define __pyx_n_s_mpfr_gamma_inc __pyx_mstate_global->__pyx_n_s_mpfr_gamma_inc +#define __pyx_n_s_mpfr_get_d __pyx_mstate_global->__pyx_n_s_mpfr_get_d +#define __pyx_n_s_mpfr_get_d_2exp __pyx_mstate_global->__pyx_n_s_mpfr_get_d_2exp +#define __pyx_n_s_mpfr_get_default_prec __pyx_mstate_global->__pyx_n_s_mpfr_get_default_prec +#define __pyx_n_s_mpfr_get_default_rounding_mode __pyx_mstate_global->__pyx_n_s_mpfr_get_default_rounding_mode +#define __pyx_n_s_mpfr_get_emax __pyx_mstate_global->__pyx_n_s_mpfr_get_emax +#define __pyx_n_s_mpfr_get_emax_max __pyx_mstate_global->__pyx_n_s_mpfr_get_emax_max +#define __pyx_n_s_mpfr_get_emax_min __pyx_mstate_global->__pyx_n_s_mpfr_get_emax_min +#define __pyx_n_s_mpfr_get_emin __pyx_mstate_global->__pyx_n_s_mpfr_get_emin +#define __pyx_n_s_mpfr_get_emin_max __pyx_mstate_global->__pyx_n_s_mpfr_get_emin_max +#define __pyx_n_s_mpfr_get_emin_min __pyx_mstate_global->__pyx_n_s_mpfr_get_emin_min +#define __pyx_n_s_mpfr_get_exp __pyx_mstate_global->__pyx_n_s_mpfr_get_exp +#define __pyx_n_s_mpfr_get_patches __pyx_mstate_global->__pyx_n_s_mpfr_get_patches +#define __pyx_n_s_mpfr_get_prec __pyx_mstate_global->__pyx_n_s_mpfr_get_prec +#define __pyx_n_s_mpfr_get_si __pyx_mstate_global->__pyx_n_s_mpfr_get_si +#define __pyx_n_s_mpfr_get_str __pyx_mstate_global->__pyx_n_s_mpfr_get_str +#define __pyx_n_s_mpfr_get_ui __pyx_mstate_global->__pyx_n_s_mpfr_get_ui +#define __pyx_n_s_mpfr_get_version __pyx_mstate_global->__pyx_n_s_mpfr_get_version +#define __pyx_n_s_mpfr_get_z __pyx_mstate_global->__pyx_n_s_mpfr_get_z +#define __pyx_n_s_mpfr_get_z_2exp __pyx_mstate_global->__pyx_n_s_mpfr_get_z_2exp +#define __pyx_n_s_mpfr_greater_p __pyx_mstate_global->__pyx_n_s_mpfr_greater_p +#define __pyx_n_s_mpfr_greaterequal_p __pyx_mstate_global->__pyx_n_s_mpfr_greaterequal_p +#define __pyx_n_s_mpfr_hypot __pyx_mstate_global->__pyx_n_s_mpfr_hypot +#define __pyx_n_s_mpfr_inexflag_p __pyx_mstate_global->__pyx_n_s_mpfr_inexflag_p +#define __pyx_n_s_mpfr_inf_p __pyx_mstate_global->__pyx_n_s_mpfr_inf_p +#define __pyx_n_s_mpfr_init __pyx_mstate_global->__pyx_n_s_mpfr_init +#define __pyx_n_s_mpfr_init2 __pyx_mstate_global->__pyx_n_s_mpfr_init2 +#define __pyx_n_s_mpfr_initialized_p __pyx_mstate_global->__pyx_n_s_mpfr_initialized_p +#define __pyx_n_s_mpfr_inits __pyx_mstate_global->__pyx_n_s_mpfr_inits +#define __pyx_n_s_mpfr_inits2 __pyx_mstate_global->__pyx_n_s_mpfr_inits2 +#define __pyx_n_s_mpfr_integer_p __pyx_mstate_global->__pyx_n_s_mpfr_integer_p +#define __pyx_n_s_mpfr_j0 __pyx_mstate_global->__pyx_n_s_mpfr_j0 +#define __pyx_n_s_mpfr_j1 __pyx_mstate_global->__pyx_n_s_mpfr_j1 +#define __pyx_n_s_mpfr_jn __pyx_mstate_global->__pyx_n_s_mpfr_jn +#define __pyx_n_s_mpfr_less_p __pyx_mstate_global->__pyx_n_s_mpfr_less_p +#define __pyx_n_s_mpfr_lessequal_p __pyx_mstate_global->__pyx_n_s_mpfr_lessequal_p +#define __pyx_n_s_mpfr_lessgreater_p __pyx_mstate_global->__pyx_n_s_mpfr_lessgreater_p +#define __pyx_n_s_mpfr_lgamma __pyx_mstate_global->__pyx_n_s_mpfr_lgamma +#define __pyx_n_s_mpfr_li2 __pyx_mstate_global->__pyx_n_s_mpfr_li2 +#define __pyx_n_s_mpfr_lngamma __pyx_mstate_global->__pyx_n_s_mpfr_lngamma +#define __pyx_n_s_mpfr_log __pyx_mstate_global->__pyx_n_s_mpfr_log +#define __pyx_n_s_mpfr_log10 __pyx_mstate_global->__pyx_n_s_mpfr_log10 +#define __pyx_n_s_mpfr_log1p __pyx_mstate_global->__pyx_n_s_mpfr_log1p +#define __pyx_n_s_mpfr_log2 __pyx_mstate_global->__pyx_n_s_mpfr_log2 +#define __pyx_n_s_mpfr_log_ui __pyx_mstate_global->__pyx_n_s_mpfr_log_ui +#define __pyx_n_s_mpfr_max __pyx_mstate_global->__pyx_n_s_mpfr_max +#define __pyx_n_s_mpfr_min __pyx_mstate_global->__pyx_n_s_mpfr_min +#define __pyx_n_s_mpfr_min_prec __pyx_mstate_global->__pyx_n_s_mpfr_min_prec +#define __pyx_n_s_mpfr_modf __pyx_mstate_global->__pyx_n_s_mpfr_modf +#define __pyx_n_s_mpfr_mp_memory_cleanup __pyx_mstate_global->__pyx_n_s_mpfr_mp_memory_cleanup +#define __pyx_kp_u_mpfr_mp_memory_cleanup_returned __pyx_mstate_global->__pyx_kp_u_mpfr_mp_memory_cleanup_returned +#define __pyx_n_s_mpfr_mul __pyx_mstate_global->__pyx_n_s_mpfr_mul +#define __pyx_n_s_mpfr_nan_p __pyx_mstate_global->__pyx_n_s_mpfr_nan_p +#define __pyx_n_s_mpfr_nanflag_p __pyx_mstate_global->__pyx_n_s_mpfr_nanflag_p +#define __pyx_n_s_mpfr_neg __pyx_mstate_global->__pyx_n_s_mpfr_neg +#define __pyx_n_s_mpfr_nextabove __pyx_mstate_global->__pyx_n_s_mpfr_nextabove +#define __pyx_n_s_mpfr_nextbelow __pyx_mstate_global->__pyx_n_s_mpfr_nextbelow +#define __pyx_n_s_mpfr_nexttoward __pyx_mstate_global->__pyx_n_s_mpfr_nexttoward +#define __pyx_n_s_mpfr_number_p __pyx_mstate_global->__pyx_n_s_mpfr_number_p +#define __pyx_n_s_mpfr_overflow_p __pyx_mstate_global->__pyx_n_s_mpfr_overflow_p +#define __pyx_n_s_mpfr_pow __pyx_mstate_global->__pyx_n_s_mpfr_pow +#define __pyx_n_s_mpfr_prec_round __pyx_mstate_global->__pyx_n_s_mpfr_prec_round +#define __pyx_n_s_mpfr_print_rnd_mode __pyx_mstate_global->__pyx_n_s_mpfr_print_rnd_mode +#define __pyx_kp_s_mpfr_pyx __pyx_mstate_global->__pyx_kp_s_mpfr_pyx +#define __pyx_n_s_mpfr_rec_sqrt __pyx_mstate_global->__pyx_n_s_mpfr_rec_sqrt +#define __pyx_n_s_mpfr_regular_p __pyx_mstate_global->__pyx_n_s_mpfr_regular_p +#define __pyx_n_s_mpfr_remainder __pyx_mstate_global->__pyx_n_s_mpfr_remainder +#define __pyx_n_s_mpfr_remquo __pyx_mstate_global->__pyx_n_s_mpfr_remquo +#define __pyx_n_s_mpfr_rint __pyx_mstate_global->__pyx_n_s_mpfr_rint +#define __pyx_n_s_mpfr_rint_ceil __pyx_mstate_global->__pyx_n_s_mpfr_rint_ceil +#define __pyx_n_s_mpfr_rint_floor __pyx_mstate_global->__pyx_n_s_mpfr_rint_floor +#define __pyx_n_s_mpfr_rint_round __pyx_mstate_global->__pyx_n_s_mpfr_rint_round +#define __pyx_n_s_mpfr_rint_roundeven __pyx_mstate_global->__pyx_n_s_mpfr_rint_roundeven +#define __pyx_n_s_mpfr_rint_trunc __pyx_mstate_global->__pyx_n_s_mpfr_rint_trunc +#define __pyx_n_s_mpfr_root __pyx_mstate_global->__pyx_n_s_mpfr_root +#define __pyx_kp_u_mpfr_root_is_deprecated_Use_mpfr __pyx_mstate_global->__pyx_kp_u_mpfr_root_is_deprecated_Use_mpfr +#define __pyx_n_s_mpfr_root_no_warn __pyx_mstate_global->__pyx_n_s_mpfr_root_no_warn +#define __pyx_n_s_mpfr_rootn_ui __pyx_mstate_global->__pyx_n_s_mpfr_rootn_ui +#define __pyx_n_s_mpfr_round __pyx_mstate_global->__pyx_n_s_mpfr_round +#define __pyx_n_s_mpfr_roundeven __pyx_mstate_global->__pyx_n_s_mpfr_roundeven +#define __pyx_n_s_mpfr_sec __pyx_mstate_global->__pyx_n_s_mpfr_sec +#define __pyx_n_s_mpfr_sech __pyx_mstate_global->__pyx_n_s_mpfr_sech +#define __pyx_n_s_mpfr_set __pyx_mstate_global->__pyx_n_s_mpfr_set +#define __pyx_n_s_mpfr_set_d __pyx_mstate_global->__pyx_n_s_mpfr_set_d +#define __pyx_n_s_mpfr_set_default_prec __pyx_mstate_global->__pyx_n_s_mpfr_set_default_prec +#define __pyx_n_s_mpfr_set_default_rounding_mode __pyx_mstate_global->__pyx_n_s_mpfr_set_default_rounding_mode +#define __pyx_n_s_mpfr_set_divby0 __pyx_mstate_global->__pyx_n_s_mpfr_set_divby0 +#define __pyx_n_s_mpfr_set_emax __pyx_mstate_global->__pyx_n_s_mpfr_set_emax +#define __pyx_n_s_mpfr_set_emin __pyx_mstate_global->__pyx_n_s_mpfr_set_emin +#define __pyx_n_s_mpfr_set_erangeflag __pyx_mstate_global->__pyx_n_s_mpfr_set_erangeflag +#define __pyx_n_s_mpfr_set_exp __pyx_mstate_global->__pyx_n_s_mpfr_set_exp +#define __pyx_n_s_mpfr_set_inexflag __pyx_mstate_global->__pyx_n_s_mpfr_set_inexflag +#define __pyx_n_s_mpfr_set_inf __pyx_mstate_global->__pyx_n_s_mpfr_set_inf +#define __pyx_n_s_mpfr_set_nan __pyx_mstate_global->__pyx_n_s_mpfr_set_nan +#define __pyx_n_s_mpfr_set_nanflag __pyx_mstate_global->__pyx_n_s_mpfr_set_nanflag +#define __pyx_n_s_mpfr_set_overflow __pyx_mstate_global->__pyx_n_s_mpfr_set_overflow +#define __pyx_n_s_mpfr_set_prec __pyx_mstate_global->__pyx_n_s_mpfr_set_prec +#define __pyx_n_s_mpfr_set_si __pyx_mstate_global->__pyx_n_s_mpfr_set_si +#define __pyx_n_s_mpfr_set_si_2exp __pyx_mstate_global->__pyx_n_s_mpfr_set_si_2exp +#define __pyx_n_s_mpfr_set_str __pyx_mstate_global->__pyx_n_s_mpfr_set_str +#define __pyx_n_s_mpfr_set_ui __pyx_mstate_global->__pyx_n_s_mpfr_set_ui +#define __pyx_n_s_mpfr_set_ui_2exp __pyx_mstate_global->__pyx_n_s_mpfr_set_ui_2exp +#define __pyx_n_s_mpfr_set_underflow __pyx_mstate_global->__pyx_n_s_mpfr_set_underflow +#define __pyx_n_s_mpfr_set_z __pyx_mstate_global->__pyx_n_s_mpfr_set_z +#define __pyx_n_s_mpfr_set_z_2exp __pyx_mstate_global->__pyx_n_s_mpfr_set_z_2exp +#define __pyx_n_s_mpfr_set_zero __pyx_mstate_global->__pyx_n_s_mpfr_set_zero +#define __pyx_n_s_mpfr_setsign __pyx_mstate_global->__pyx_n_s_mpfr_setsign +#define __pyx_n_s_mpfr_sgn __pyx_mstate_global->__pyx_n_s_mpfr_sgn +#define __pyx_n_s_mpfr_signbit __pyx_mstate_global->__pyx_n_s_mpfr_signbit +#define __pyx_n_s_mpfr_sin __pyx_mstate_global->__pyx_n_s_mpfr_sin +#define __pyx_n_s_mpfr_sin_cos __pyx_mstate_global->__pyx_n_s_mpfr_sin_cos +#define __pyx_n_s_mpfr_sinh __pyx_mstate_global->__pyx_n_s_mpfr_sinh +#define __pyx_n_s_mpfr_sinh_cosh __pyx_mstate_global->__pyx_n_s_mpfr_sinh_cosh +#define __pyx_n_s_mpfr_sqr __pyx_mstate_global->__pyx_n_s_mpfr_sqr +#define __pyx_n_s_mpfr_sqrt __pyx_mstate_global->__pyx_n_s_mpfr_sqrt +#define __pyx_n_s_mpfr_strtofr __pyx_mstate_global->__pyx_n_s_mpfr_strtofr +#define __pyx_n_s_mpfr_sub __pyx_mstate_global->__pyx_n_s_mpfr_sub +#define __pyx_n_s_mpfr_subnormalize __pyx_mstate_global->__pyx_n_s_mpfr_subnormalize +#define __pyx_n_s_mpfr_sum __pyx_mstate_global->__pyx_n_s_mpfr_sum +#define __pyx_n_s_mpfr_swap __pyx_mstate_global->__pyx_n_s_mpfr_swap +#define __pyx_n_s_mpfr_tan __pyx_mstate_global->__pyx_n_s_mpfr_tan +#define __pyx_n_s_mpfr_tanh __pyx_mstate_global->__pyx_n_s_mpfr_tanh +#define __pyx_n_s_mpfr_trunc __pyx_mstate_global->__pyx_n_s_mpfr_trunc +#define __pyx_n_s_mpfr_underflow_p __pyx_mstate_global->__pyx_n_s_mpfr_underflow_p +#define __pyx_n_s_mpfr_unordered_p __pyx_mstate_global->__pyx_n_s_mpfr_unordered_p +#define __pyx_n_s_mpfr_y0 __pyx_mstate_global->__pyx_n_s_mpfr_y0 +#define __pyx_n_s_mpfr_y1 __pyx_mstate_global->__pyx_n_s_mpfr_y1 +#define __pyx_n_s_mpfr_yn __pyx_mstate_global->__pyx_n_s_mpfr_yn +#define __pyx_n_s_mpfr_zero_p __pyx_mstate_global->__pyx_n_s_mpfr_zero_p +#define __pyx_n_s_mpfr_zeta __pyx_mstate_global->__pyx_n_s_mpfr_zeta +#define __pyx_n_s_mpfr_zeta_ui __pyx_mstate_global->__pyx_n_s_mpfr_zeta_ui +#define __pyx_n_s_mpz_get_str __pyx_mstate_global->__pyx_n_s_mpz_get_str +#define __pyx_n_s_mpz_set_str __pyx_mstate_global->__pyx_n_s_mpz_set_str +#define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n +#define __pyx_kp_u_n_should_be_either_0_or_at_least __pyx_mstate_global->__pyx_kp_u_n_should_be_either_0_or_at_least +#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_kp_u_new_exponent_for_emin_is_outside __pyx_mstate_global->__pyx_kp_u_new_exponent_for_emin_is_outside +#define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non +#define __pyx_n_s_op __pyx_mstate_global->__pyx_n_s_op +#define __pyx_n_s_op1 __pyx_mstate_global->__pyx_n_s_op1 +#define __pyx_n_s_op2 __pyx_mstate_global->__pyx_n_s_op2 +#define __pyx_n_s_op3 __pyx_mstate_global->__pyx_n_s_op3 +#define __pyx_n_s_op4 __pyx_mstate_global->__pyx_n_s_op4 +#define __pyx_n_s_output __pyx_mstate_global->__pyx_n_s_output +#define __pyx_n_s_output_as_bytes __pyx_mstate_global->__pyx_n_s_output_as_bytes +#define __pyx_n_s_patches __pyx_mstate_global->__pyx_n_s_patches +#define __pyx_n_s_patchlevel __pyx_mstate_global->__pyx_n_s_patchlevel +#define __pyx_n_s_pointers __pyx_mstate_global->__pyx_n_s_pointers +#define __pyx_n_s_prec __pyx_mstate_global->__pyx_n_s_prec +#define __pyx_kp_u_precision_should_be_between_and __pyx_mstate_global->__pyx_kp_u_precision_should_be_between_and +#define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state +#define __pyx_n_s_quotient __pyx_mstate_global->__pyx_n_s_quotient +#define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r +#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range +#define __pyx_n_s_rc __pyx_mstate_global->__pyx_n_s_rc +#define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce +#define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython +#define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex +#define __pyx_n_s_rnd __pyx_mstate_global->__pyx_n_s_rnd +#define __pyx_n_s_rnd1 __pyx_mstate_global->__pyx_n_s_rnd1 +#define __pyx_n_s_rnd2 __pyx_mstate_global->__pyx_n_s_rnd2 +#define __pyx_n_s_rop __pyx_mstate_global->__pyx_n_s_rop +#define __pyx_n_s_rounding_mode __pyx_mstate_global->__pyx_n_s_rounding_mode +#define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv +#define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s +#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self +#define __pyx_kp_s_self__value_cannot_be_converted __pyx_mstate_global->__pyx_kp_s_self__value_cannot_be_converted +#define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate +#define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython +#define __pyx_n_s_sign __pyx_mstate_global->__pyx_n_s_sign +#define __pyx_n_s_signp __pyx_mstate_global->__pyx_n_s_signp +#define __pyx_n_s_sop __pyx_mstate_global->__pyx_n_s_sop +#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec +#define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split +#define __pyx_n_s_startptr __pyx_mstate_global->__pyx_n_s_startptr +#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource +#define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys +#define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t +#define __pyx_n_s_tab __pyx_mstate_global->__pyx_n_s_tab +#define __pyx_n_s_template __pyx_mstate_global->__pyx_n_s_template +#define __pyx_n_s_template_bytes __pyx_mstate_global->__pyx_n_s_template_bytes +#define __pyx_n_s_ternary __pyx_mstate_global->__pyx_n_s_ternary +#define __pyx_n_s_ternary_pair __pyx_mstate_global->__pyx_n_s_ternary_pair +#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test +#define __pyx_n_s_thresholds __pyx_mstate_global->__pyx_n_s_thresholds +#define __pyx_n_s_version __pyx_mstate_global->__pyx_n_s_version +#define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info +#define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn +#define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings +#define __pyx_n_s_way __pyx_mstate_global->__pyx_n_s_way +#define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x +#define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y +#define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 +#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ +#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 +#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 +#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 +#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 +#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 +#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 +#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 +#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 +#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 +#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 +#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13 +#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 +#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 +#define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 +#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23 +#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25 +#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27 +#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29 +#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 +#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 +#define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40 +#define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46 +#define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50 +#define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 +#define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55 +#define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58 +#define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60 +#define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 +#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 +#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 +#define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 +#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 +#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76 +#define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85 +#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 +#define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121 +#define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129 +#define __pyx_tuple__145 __pyx_mstate_global->__pyx_tuple__145 +#define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148 +#define __pyx_tuple__158 __pyx_mstate_global->__pyx_tuple__158 +#define __pyx_tuple__163 __pyx_mstate_global->__pyx_tuple__163 +#define __pyx_tuple__166 __pyx_mstate_global->__pyx_tuple__166 +#define __pyx_tuple__170 __pyx_mstate_global->__pyx_tuple__170 +#define __pyx_tuple__173 __pyx_mstate_global->__pyx_tuple__173 +#define __pyx_tuple__179 __pyx_mstate_global->__pyx_tuple__179 +#define __pyx_tuple__182 __pyx_mstate_global->__pyx_tuple__182 +#define __pyx_tuple__184 __pyx_mstate_global->__pyx_tuple__184 +#define __pyx_tuple__186 __pyx_mstate_global->__pyx_tuple__186 +#define __pyx_tuple__189 __pyx_mstate_global->__pyx_tuple__189 +#define __pyx_tuple__201 __pyx_mstate_global->__pyx_tuple__201 +#define __pyx_tuple__203 __pyx_mstate_global->__pyx_tuple__203 +#define __pyx_tuple__205 __pyx_mstate_global->__pyx_tuple__205 +#define __pyx_tuple__210 __pyx_mstate_global->__pyx_tuple__210 +#define __pyx_tuple__213 __pyx_mstate_global->__pyx_tuple__213 +#define __pyx_tuple__215 __pyx_mstate_global->__pyx_tuple__215 +#define __pyx_tuple__218 __pyx_mstate_global->__pyx_tuple__218 +#define __pyx_tuple__226 __pyx_mstate_global->__pyx_tuple__226 +#define __pyx_tuple__229 __pyx_mstate_global->__pyx_tuple__229 +#define __pyx_tuple__232 __pyx_mstate_global->__pyx_tuple__232 +#define __pyx_tuple__234 __pyx_mstate_global->__pyx_tuple__234 +#define __pyx_tuple__236 __pyx_mstate_global->__pyx_tuple__236 +#define __pyx_tuple__243 __pyx_mstate_global->__pyx_tuple__243 +#define __pyx_tuple__247 __pyx_mstate_global->__pyx_tuple__247 +#define __pyx_tuple__254 __pyx_mstate_global->__pyx_tuple__254 +#define __pyx_tuple__276 __pyx_mstate_global->__pyx_tuple__276 +#define __pyx_tuple__281 __pyx_mstate_global->__pyx_tuple__281 +#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 +#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 +#define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 +#define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 +#define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 +#define __pyx_codeobj__22 __pyx_mstate_global->__pyx_codeobj__22 +#define __pyx_codeobj__24 __pyx_mstate_global->__pyx_codeobj__24 +#define __pyx_codeobj__26 __pyx_mstate_global->__pyx_codeobj__26 +#define __pyx_codeobj__28 __pyx_mstate_global->__pyx_codeobj__28 +#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 +#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 +#define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 +#define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 +#define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 +#define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 +#define __pyx_codeobj__38 __pyx_mstate_global->__pyx_codeobj__38 +#define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 +#define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41 +#define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 +#define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43 +#define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 +#define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45 +#define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47 +#define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 +#define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49 +#define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 +#define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 +#define __pyx_codeobj__54 __pyx_mstate_global->__pyx_codeobj__54 +#define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56 +#define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 +#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 +#define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61 +#define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62 +#define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63 +#define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 +#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 +#define __pyx_codeobj__69 __pyx_mstate_global->__pyx_codeobj__69 +#define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 +#define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72 +#define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 +#define __pyx_codeobj__75 __pyx_mstate_global->__pyx_codeobj__75 +#define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 +#define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 +#define __pyx_codeobj__79 __pyx_mstate_global->__pyx_codeobj__79 +#define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 +#define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81 +#define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82 +#define __pyx_codeobj__83 __pyx_mstate_global->__pyx_codeobj__83 +#define __pyx_codeobj__84 __pyx_mstate_global->__pyx_codeobj__84 +#define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86 +#define __pyx_codeobj__87 __pyx_mstate_global->__pyx_codeobj__87 +#define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88 +#define __pyx_codeobj__89 __pyx_mstate_global->__pyx_codeobj__89 +#define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90 +#define __pyx_codeobj__91 __pyx_mstate_global->__pyx_codeobj__91 +#define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92 +#define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94 +#define __pyx_codeobj__95 __pyx_mstate_global->__pyx_codeobj__95 +#define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96 +#define __pyx_codeobj__97 __pyx_mstate_global->__pyx_codeobj__97 +#define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98 +#define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99 +#define __pyx_codeobj__100 __pyx_mstate_global->__pyx_codeobj__100 +#define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101 +#define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102 +#define __pyx_codeobj__103 __pyx_mstate_global->__pyx_codeobj__103 +#define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104 +#define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105 +#define __pyx_codeobj__106 __pyx_mstate_global->__pyx_codeobj__106 +#define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107 +#define __pyx_codeobj__108 __pyx_mstate_global->__pyx_codeobj__108 +#define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109 +#define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110 +#define __pyx_codeobj__111 __pyx_mstate_global->__pyx_codeobj__111 +#define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112 +#define __pyx_codeobj__113 __pyx_mstate_global->__pyx_codeobj__113 +#define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114 +#define __pyx_codeobj__115 __pyx_mstate_global->__pyx_codeobj__115 +#define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116 +#define __pyx_codeobj__117 __pyx_mstate_global->__pyx_codeobj__117 +#define __pyx_codeobj__118 __pyx_mstate_global->__pyx_codeobj__118 +#define __pyx_codeobj__119 __pyx_mstate_global->__pyx_codeobj__119 +#define __pyx_codeobj__120 __pyx_mstate_global->__pyx_codeobj__120 +#define __pyx_codeobj__122 __pyx_mstate_global->__pyx_codeobj__122 +#define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123 +#define __pyx_codeobj__124 __pyx_mstate_global->__pyx_codeobj__124 +#define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125 +#define __pyx_codeobj__126 __pyx_mstate_global->__pyx_codeobj__126 +#define __pyx_codeobj__127 __pyx_mstate_global->__pyx_codeobj__127 +#define __pyx_codeobj__128 __pyx_mstate_global->__pyx_codeobj__128 +#define __pyx_codeobj__130 __pyx_mstate_global->__pyx_codeobj__130 +#define __pyx_codeobj__131 __pyx_mstate_global->__pyx_codeobj__131 +#define __pyx_codeobj__132 __pyx_mstate_global->__pyx_codeobj__132 +#define __pyx_codeobj__133 __pyx_mstate_global->__pyx_codeobj__133 +#define __pyx_codeobj__134 __pyx_mstate_global->__pyx_codeobj__134 +#define __pyx_codeobj__135 __pyx_mstate_global->__pyx_codeobj__135 +#define __pyx_codeobj__136 __pyx_mstate_global->__pyx_codeobj__136 +#define __pyx_codeobj__137 __pyx_mstate_global->__pyx_codeobj__137 +#define __pyx_codeobj__138 __pyx_mstate_global->__pyx_codeobj__138 +#define __pyx_codeobj__139 __pyx_mstate_global->__pyx_codeobj__139 +#define __pyx_codeobj__140 __pyx_mstate_global->__pyx_codeobj__140 +#define __pyx_codeobj__141 __pyx_mstate_global->__pyx_codeobj__141 +#define __pyx_codeobj__142 __pyx_mstate_global->__pyx_codeobj__142 +#define __pyx_codeobj__143 __pyx_mstate_global->__pyx_codeobj__143 +#define __pyx_codeobj__144 __pyx_mstate_global->__pyx_codeobj__144 +#define __pyx_codeobj__146 __pyx_mstate_global->__pyx_codeobj__146 +#define __pyx_codeobj__147 __pyx_mstate_global->__pyx_codeobj__147 +#define __pyx_codeobj__149 __pyx_mstate_global->__pyx_codeobj__149 +#define __pyx_codeobj__150 __pyx_mstate_global->__pyx_codeobj__150 +#define __pyx_codeobj__151 __pyx_mstate_global->__pyx_codeobj__151 +#define __pyx_codeobj__152 __pyx_mstate_global->__pyx_codeobj__152 +#define __pyx_codeobj__153 __pyx_mstate_global->__pyx_codeobj__153 +#define __pyx_codeobj__154 __pyx_mstate_global->__pyx_codeobj__154 +#define __pyx_codeobj__155 __pyx_mstate_global->__pyx_codeobj__155 +#define __pyx_codeobj__156 __pyx_mstate_global->__pyx_codeobj__156 +#define __pyx_codeobj__157 __pyx_mstate_global->__pyx_codeobj__157 +#define __pyx_codeobj__159 __pyx_mstate_global->__pyx_codeobj__159 +#define __pyx_codeobj__160 __pyx_mstate_global->__pyx_codeobj__160 +#define __pyx_codeobj__161 __pyx_mstate_global->__pyx_codeobj__161 +#define __pyx_codeobj__162 __pyx_mstate_global->__pyx_codeobj__162 +#define __pyx_codeobj__164 __pyx_mstate_global->__pyx_codeobj__164 +#define __pyx_codeobj__165 __pyx_mstate_global->__pyx_codeobj__165 +#define __pyx_codeobj__167 __pyx_mstate_global->__pyx_codeobj__167 +#define __pyx_codeobj__168 __pyx_mstate_global->__pyx_codeobj__168 +#define __pyx_codeobj__169 __pyx_mstate_global->__pyx_codeobj__169 +#define __pyx_codeobj__171 __pyx_mstate_global->__pyx_codeobj__171 +#define __pyx_codeobj__172 __pyx_mstate_global->__pyx_codeobj__172 +#define __pyx_codeobj__174 __pyx_mstate_global->__pyx_codeobj__174 +#define __pyx_codeobj__175 __pyx_mstate_global->__pyx_codeobj__175 +#define __pyx_codeobj__176 __pyx_mstate_global->__pyx_codeobj__176 +#define __pyx_codeobj__177 __pyx_mstate_global->__pyx_codeobj__177 +#define __pyx_codeobj__178 __pyx_mstate_global->__pyx_codeobj__178 +#define __pyx_codeobj__180 __pyx_mstate_global->__pyx_codeobj__180 +#define __pyx_codeobj__181 __pyx_mstate_global->__pyx_codeobj__181 +#define __pyx_codeobj__183 __pyx_mstate_global->__pyx_codeobj__183 +#define __pyx_codeobj__185 __pyx_mstate_global->__pyx_codeobj__185 +#define __pyx_codeobj__187 __pyx_mstate_global->__pyx_codeobj__187 +#define __pyx_codeobj__188 __pyx_mstate_global->__pyx_codeobj__188 +#define __pyx_codeobj__190 __pyx_mstate_global->__pyx_codeobj__190 +#define __pyx_codeobj__191 __pyx_mstate_global->__pyx_codeobj__191 +#define __pyx_codeobj__192 __pyx_mstate_global->__pyx_codeobj__192 +#define __pyx_codeobj__193 __pyx_mstate_global->__pyx_codeobj__193 +#define __pyx_codeobj__194 __pyx_mstate_global->__pyx_codeobj__194 +#define __pyx_codeobj__195 __pyx_mstate_global->__pyx_codeobj__195 +#define __pyx_codeobj__196 __pyx_mstate_global->__pyx_codeobj__196 +#define __pyx_codeobj__197 __pyx_mstate_global->__pyx_codeobj__197 +#define __pyx_codeobj__198 __pyx_mstate_global->__pyx_codeobj__198 +#define __pyx_codeobj__199 __pyx_mstate_global->__pyx_codeobj__199 +#define __pyx_codeobj__200 __pyx_mstate_global->__pyx_codeobj__200 +#define __pyx_codeobj__202 __pyx_mstate_global->__pyx_codeobj__202 +#define __pyx_codeobj__204 __pyx_mstate_global->__pyx_codeobj__204 +#define __pyx_codeobj__206 __pyx_mstate_global->__pyx_codeobj__206 +#define __pyx_codeobj__207 __pyx_mstate_global->__pyx_codeobj__207 +#define __pyx_codeobj__208 __pyx_mstate_global->__pyx_codeobj__208 +#define __pyx_codeobj__209 __pyx_mstate_global->__pyx_codeobj__209 +#define __pyx_codeobj__211 __pyx_mstate_global->__pyx_codeobj__211 +#define __pyx_codeobj__212 __pyx_mstate_global->__pyx_codeobj__212 +#define __pyx_codeobj__214 __pyx_mstate_global->__pyx_codeobj__214 +#define __pyx_codeobj__216 __pyx_mstate_global->__pyx_codeobj__216 +#define __pyx_codeobj__217 __pyx_mstate_global->__pyx_codeobj__217 +#define __pyx_codeobj__219 __pyx_mstate_global->__pyx_codeobj__219 +#define __pyx_codeobj__220 __pyx_mstate_global->__pyx_codeobj__220 +#define __pyx_codeobj__221 __pyx_mstate_global->__pyx_codeobj__221 +#define __pyx_codeobj__222 __pyx_mstate_global->__pyx_codeobj__222 +#define __pyx_codeobj__223 __pyx_mstate_global->__pyx_codeobj__223 +#define __pyx_codeobj__224 __pyx_mstate_global->__pyx_codeobj__224 +#define __pyx_codeobj__225 __pyx_mstate_global->__pyx_codeobj__225 +#define __pyx_codeobj__227 __pyx_mstate_global->__pyx_codeobj__227 +#define __pyx_codeobj__228 __pyx_mstate_global->__pyx_codeobj__228 +#define __pyx_codeobj__230 __pyx_mstate_global->__pyx_codeobj__230 +#define __pyx_codeobj__231 __pyx_mstate_global->__pyx_codeobj__231 +#define __pyx_codeobj__233 __pyx_mstate_global->__pyx_codeobj__233 +#define __pyx_codeobj__235 __pyx_mstate_global->__pyx_codeobj__235 +#define __pyx_codeobj__237 __pyx_mstate_global->__pyx_codeobj__237 +#define __pyx_codeobj__238 __pyx_mstate_global->__pyx_codeobj__238 +#define __pyx_codeobj__239 __pyx_mstate_global->__pyx_codeobj__239 +#define __pyx_codeobj__240 __pyx_mstate_global->__pyx_codeobj__240 +#define __pyx_codeobj__241 __pyx_mstate_global->__pyx_codeobj__241 +#define __pyx_codeobj__242 __pyx_mstate_global->__pyx_codeobj__242 +#define __pyx_codeobj__244 __pyx_mstate_global->__pyx_codeobj__244 +#define __pyx_codeobj__245 __pyx_mstate_global->__pyx_codeobj__245 +#define __pyx_codeobj__246 __pyx_mstate_global->__pyx_codeobj__246 +#define __pyx_codeobj__248 __pyx_mstate_global->__pyx_codeobj__248 +#define __pyx_codeobj__249 __pyx_mstate_global->__pyx_codeobj__249 +#define __pyx_codeobj__250 __pyx_mstate_global->__pyx_codeobj__250 +#define __pyx_codeobj__251 __pyx_mstate_global->__pyx_codeobj__251 +#define __pyx_codeobj__252 __pyx_mstate_global->__pyx_codeobj__252 +#define __pyx_codeobj__253 __pyx_mstate_global->__pyx_codeobj__253 +#define __pyx_codeobj__255 __pyx_mstate_global->__pyx_codeobj__255 +#define __pyx_codeobj__256 __pyx_mstate_global->__pyx_codeobj__256 +#define __pyx_codeobj__257 __pyx_mstate_global->__pyx_codeobj__257 +#define __pyx_codeobj__258 __pyx_mstate_global->__pyx_codeobj__258 +#define __pyx_codeobj__259 __pyx_mstate_global->__pyx_codeobj__259 +#define __pyx_codeobj__260 __pyx_mstate_global->__pyx_codeobj__260 +#define __pyx_codeobj__261 __pyx_mstate_global->__pyx_codeobj__261 +#define __pyx_codeobj__262 __pyx_mstate_global->__pyx_codeobj__262 +#define __pyx_codeobj__263 __pyx_mstate_global->__pyx_codeobj__263 +#define __pyx_codeobj__264 __pyx_mstate_global->__pyx_codeobj__264 +#define __pyx_codeobj__265 __pyx_mstate_global->__pyx_codeobj__265 +#define __pyx_codeobj__266 __pyx_mstate_global->__pyx_codeobj__266 +#define __pyx_codeobj__267 __pyx_mstate_global->__pyx_codeobj__267 +#define __pyx_codeobj__268 __pyx_mstate_global->__pyx_codeobj__268 +#define __pyx_codeobj__269 __pyx_mstate_global->__pyx_codeobj__269 +#define __pyx_codeobj__270 __pyx_mstate_global->__pyx_codeobj__270 +#define __pyx_codeobj__271 __pyx_mstate_global->__pyx_codeobj__271 +#define __pyx_codeobj__272 __pyx_mstate_global->__pyx_codeobj__272 +#define __pyx_codeobj__273 __pyx_mstate_global->__pyx_codeobj__273 +#define __pyx_codeobj__274 __pyx_mstate_global->__pyx_codeobj__274 +#define __pyx_codeobj__275 __pyx_mstate_global->__pyx_codeobj__275 +#define __pyx_codeobj__277 __pyx_mstate_global->__pyx_codeobj__277 +#define __pyx_codeobj__278 __pyx_mstate_global->__pyx_codeobj__278 +#define __pyx_codeobj__279 __pyx_mstate_global->__pyx_codeobj__279 +#define __pyx_codeobj__280 __pyx_mstate_global->__pyx_codeobj__280 +#define __pyx_codeobj__282 __pyx_mstate_global->__pyx_codeobj__282 +/* #### Code section: module_code ### */ + +/* "mpfr.pyx":48 + * cdef cgmp.__mpz_struct _value + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * cgmp.mpz_init(&self._value) + * + */ + +/* Python wrapper */ +static int __pyx_pw_4mpfr_5Mpz_t_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_4mpfr_5Mpz_t_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1; + #endif + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; + __pyx_r = __pyx_pf_4mpfr_5Mpz_t___cinit__(((struct __pyx_obj_4mpfr_Mpz_t *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_4mpfr_5Mpz_t___cinit__(struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_self) { + int __pyx_r; + + /* "mpfr.pyx":49 + * + * def __cinit__(self): + * cgmp.mpz_init(&self._value) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + mpz_init((&__pyx_v_self->_value)); + + /* "mpfr.pyx":48 + * cdef cgmp.__mpz_struct _value + * + * def __cinit__(self): # <<<<<<<<<<<<<< + * cgmp.mpz_init(&self._value) + * + */ + + /* function exit code */ + __pyx_r = 0; + return __pyx_r; +} + +/* "mpfr.pyx":51 + * cgmp.mpz_init(&self._value) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * cgmp.mpz_clear(&self._value) + * + */ + +/* Python wrapper */ +static void __pyx_pw_4mpfr_5Mpz_t_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_4mpfr_5Mpz_t_3__dealloc__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_pf_4mpfr_5Mpz_t_2__dealloc__(((struct __pyx_obj_4mpfr_Mpz_t *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_4mpfr_5Mpz_t_2__dealloc__(struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_self) { + + /* "mpfr.pyx":52 + * + * def __dealloc__(self): + * cgmp.mpz_clear(&self._value) # <<<<<<<<<<<<<< + * + * + */ + mpz_clear((&__pyx_v_self->_value)); + + /* "mpfr.pyx":51 + * cgmp.mpz_init(&self._value) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * cgmp.mpz_clear(&self._value) + * + */ + + /* function exit code */ +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_5Mpz_t_5__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_5Mpz_t_4__reduce_cython__, "Mpz_t.__reduce_cython__(self)"); +static PyMethodDef __pyx_mdef_4mpfr_5Mpz_t_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_5Mpz_t_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_5Mpz_t_4__reduce_cython__}; +static PyObject *__pyx_pw_4mpfr_5Mpz_t_5__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; + __pyx_r = __pyx_pf_4mpfr_5Mpz_t_4__reduce_cython__(((struct __pyx_obj_4mpfr_Mpz_t *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_5Mpz_t_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 1); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.Mpz_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_5Mpz_t_7__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_5Mpz_t_6__setstate_cython__, "Mpz_t.__setstate_cython__(self, __pyx_state)"); +static PyMethodDef __pyx_mdef_4mpfr_5Mpz_t_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_5Mpz_t_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_5Mpz_t_6__setstate_cython__}; +static PyObject *__pyx_pw_4mpfr_5Mpz_t_7__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v___pyx_state = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.Mpz_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_5Mpz_t_6__setstate_cython__(((struct __pyx_obj_4mpfr_Mpz_t *)__pyx_v_self), __pyx_v___pyx_state); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_5Mpz_t_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 1); + + /* "(tree fragment)":4 + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<< + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0); + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.Mpz_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":55 + * + * + * def mpz_set_str(Mpz_t rop not None, object s, int base): # <<<<<<<<<<<<<< + * """ + * Set rop from a string. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_1mpz_set_str(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_mpz_set_str, "mpz_set_str(Mpz_t rop, s, int base)\n\n Set rop from a string.\n\n Set the value of rop from s, a string in base base.\n White space is allowed in the string, and is simply ignored.\n\n The base may vary from 2 to 62, or if base is 0, then the leading\n characters are used: 0x and 0X for hexadecimal, 0b and 0B for binary, 0 for\n octal, or decimal otherwise.\n\n For bases up to 36, case is ignored; upper-case and lower-case letters have\n the same value. For bases 37 to 62, upper-case letter represent the usual\n 10..35 while lower-case letter represent 36..61.\n\n Raises ValueError if the string is not a valid number in the given base.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_1mpz_set_str = {"mpz_set_str", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_1mpz_set_str, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_mpz_set_str}; +static PyObject *__pyx_pw_4mpfr_1mpz_set_str(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_rop = 0; + PyObject *__pyx_v_s = 0; + int __pyx_v_base; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpz_set_str (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_s,&__pyx_n_s_base,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpz_set_str", 1, 3, 3, 1); __PYX_ERR(1, 55, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_base)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpz_set_str", 1, 3, 3, 2); __PYX_ERR(1, 55, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpz_set_str") < 0)) __PYX_ERR(1, 55, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpz_t *)values[0]); + __pyx_v_s = values[1]; + __pyx_v_base = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_base == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpz_set_str", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 55, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpz_set_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpz_t, 0, "rop", 0))) __PYX_ERR(1, 55, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_mpz_set_str(__pyx_self, __pyx_v_rop, __pyx_v_s, __pyx_v_base); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_mpz_set_str(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_rop, PyObject *__pyx_v_s, int __pyx_v_base) { + PyObject *__pyx_v_bytes_s = 0; + int __pyx_v_err; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + char const *__pyx_t_7; + PyObject *__pyx_t_8 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpz_set_str", 1); + + /* "mpfr.pyx":76 + * cdef int err + * + * if not (2 <= base <= 62 or base == 0): # <<<<<<<<<<<<<< + * raise ValueError("base must satisfy 2 <= base <= 62 or base == 0") + * + */ + __pyx_t_2 = (2 <= __pyx_v_base); + if (__pyx_t_2) { + __pyx_t_2 = (__pyx_v_base <= 62); + } + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_base == 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + __pyx_t_2 = (!__pyx_t_1); + if (unlikely(__pyx_t_2)) { + + /* "mpfr.pyx":77 + * + * if not (2 <= base <= 62 or base == 0): + * raise ValueError("base must satisfy 2 <= base <= 62 or base == 0") # <<<<<<<<<<<<<< + * + * bytes_s = s.encode('ascii') + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 77, __pyx_L1_error) + + /* "mpfr.pyx":76 + * cdef int err + * + * if not (2 <= base <= 62 or base == 0): # <<<<<<<<<<<<<< + * raise ValueError("base must satisfy 2 <= base <= 62 or base == 0") + * + */ + } + + /* "mpfr.pyx":79 + * raise ValueError("base must satisfy 2 <= base <= 62 or base == 0") + * + * bytes_s = s.encode('ascii') # <<<<<<<<<<<<<< + * err = cgmp.mpz_set_str(&rop._value, bytes_s, base) + * if err: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_n_u_ascii}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 79, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 79, __pyx_L1_error) + __pyx_v_bytes_s = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "mpfr.pyx":80 + * + * bytes_s = s.encode('ascii') + * err = cgmp.mpz_set_str(&rop._value, bytes_s, base) # <<<<<<<<<<<<<< + * if err: + * raise ValueError("Not a valid number for base {}: {}".format( + */ + if (unlikely(__pyx_v_bytes_s == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(1, 80, __pyx_L1_error) + } + __pyx_t_7 = __Pyx_PyBytes_AsString(__pyx_v_bytes_s); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 80, __pyx_L1_error) + __pyx_v_err = mpz_set_str((&__pyx_v_rop->_value), __pyx_t_7, __pyx_v_base); + + /* "mpfr.pyx":81 + * bytes_s = s.encode('ascii') + * err = cgmp.mpz_set_str(&rop._value, bytes_s, base) + * if err: # <<<<<<<<<<<<<< + * raise ValueError("Not a valid number for base {}: {}".format( + * base, s)) + */ + __pyx_t_2 = (__pyx_v_err != 0); + if (unlikely(__pyx_t_2)) { + + /* "mpfr.pyx":82 + * err = cgmp.mpz_set_str(&rop._value, bytes_s, base) + * if err: + * raise ValueError("Not a valid number for base {}: {}".format( # <<<<<<<<<<<<<< + * base, s)) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Not_a_valid_number_for_base, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + + /* "mpfr.pyx":83 + * if err: + * raise ValueError("Not a valid number for base {}: {}".format( + * base, s)) # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_base); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 83, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_5, __pyx_v_s}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "mpfr.pyx":82 + * err = cgmp.mpz_set_str(&rop._value, bytes_s, base) + * if err: + * raise ValueError("Not a valid number for base {}: {}".format( # <<<<<<<<<<<<<< + * base, s)) + * + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 82, __pyx_L1_error) + + /* "mpfr.pyx":81 + * bytes_s = s.encode('ascii') + * err = cgmp.mpz_set_str(&rop._value, bytes_s, base) + * if err: # <<<<<<<<<<<<<< + * raise ValueError("Not a valid number for base {}: {}".format( + * base, s)) + */ + } + + /* "mpfr.pyx":55 + * + * + * def mpz_set_str(Mpz_t rop not None, object s, int base): # <<<<<<<<<<<<<< + * """ + * Set rop from a string. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("mpfr.mpz_set_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_bytes_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":86 + * + * + * def mpz_get_str(int base, Mpz_t op not None): # <<<<<<<<<<<<<< + * """ + * Convert to a string of digits in a given base. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_3mpz_get_str(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_2mpz_get_str, "mpz_get_str(int base, Mpz_t op)\n\n Convert to a string of digits in a given base.\n\n Convert op to a string of digits in base base. The base argument may vary\n from 2 to 62 or from -2 to -36.\n\n For base in the range 2..36, digits and lower-case letters are used; for\n -2..-36, digits and upper-case letters are used; for 37..62, digits,\n upper-case letters, and lower-case letters (in that significance order) are\n used.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_3mpz_get_str = {"mpz_get_str", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_3mpz_get_str, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_2mpz_get_str}; +static PyObject *__pyx_pw_4mpfr_3mpz_get_str(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + int __pyx_v_base; + struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpz_get_str (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_base,&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_base)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 86, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 86, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpz_get_str", 1, 2, 2, 1); __PYX_ERR(1, 86, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpz_get_str") < 0)) __PYX_ERR(1, 86, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_base = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_base == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 86, __pyx_L3_error) + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpz_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpz_get_str", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 86, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpz_get_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpz_t, 0, "op", 0))) __PYX_ERR(1, 86, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_2mpz_get_str(__pyx_self, __pyx_v_base, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_2mpz_get_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_base, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_op) { + PyObject *__pyx_v_digits = 0; + char *__pyx_v_c_digits; + void (*__pyx_v_freefunc)(void *, size_t); + size_t __pyx_v_c_digits_alloc; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + char const *__pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpz_get_str", 1); + + /* "mpfr.pyx":104 + * cdef size_t c_digits_len + * + * if not (2 <= base <= 62 or -36 <= base <= -2): # <<<<<<<<<<<<<< + * raise ValueError( + * "Base must satisfy 2 <= base <= 62 or -2 >= base >= -36.") + */ + __pyx_t_2 = (2 <= __pyx_v_base); + if (__pyx_t_2) { + __pyx_t_2 = (__pyx_v_base <= 62); + } + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (-36L <= __pyx_v_base); + if (__pyx_t_2) { + __pyx_t_2 = (__pyx_v_base <= -2L); + } + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + __pyx_t_2 = (!__pyx_t_1); + if (unlikely(__pyx_t_2)) { + + /* "mpfr.pyx":105 + * + * if not (2 <= base <= 62 or -36 <= base <= -2): + * raise ValueError( # <<<<<<<<<<<<<< + * "Base must satisfy 2 <= base <= 62 or -2 >= base >= -36.") + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 105, __pyx_L1_error) + + /* "mpfr.pyx":104 + * cdef size_t c_digits_len + * + * if not (2 <= base <= 62 or -36 <= base <= -2): # <<<<<<<<<<<<<< + * raise ValueError( + * "Base must satisfy 2 <= base <= 62 or -2 >= base >= -36.") + */ + } + + /* "mpfr.pyx":109 + * + * # Get the appropriate function for freeing the allocated memory. + * cgmp.mp_get_memory_functions (NULL, NULL, &freefunc); # <<<<<<<<<<<<<< + * + * c_digits = cgmp.mpz_get_str(NULL, base, &op._value) + */ + mp_get_memory_functions(NULL, NULL, (&__pyx_v_freefunc)); + + /* "mpfr.pyx":111 + * cgmp.mp_get_memory_functions (NULL, NULL, &freefunc); + * + * c_digits = cgmp.mpz_get_str(NULL, base, &op._value) # <<<<<<<<<<<<<< + * if c_digits == NULL: + * raise RuntimeError("Error during string conversion.") + */ + __pyx_v_c_digits = mpz_get_str(NULL, __pyx_v_base, (&__pyx_v_op->_value)); + + /* "mpfr.pyx":112 + * + * c_digits = cgmp.mpz_get_str(NULL, base, &op._value) + * if c_digits == NULL: # <<<<<<<<<<<<<< + * raise RuntimeError("Error during string conversion.") + * c_digits_alloc = strlen(c_digits) + 1 + */ + __pyx_t_2 = (__pyx_v_c_digits == NULL); + if (unlikely(__pyx_t_2)) { + + /* "mpfr.pyx":113 + * c_digits = cgmp.mpz_get_str(NULL, base, &op._value) + * if c_digits == NULL: + * raise RuntimeError("Error during string conversion.") # <<<<<<<<<<<<<< + * c_digits_alloc = strlen(c_digits) + 1 + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 113, __pyx_L1_error) + + /* "mpfr.pyx":112 + * + * c_digits = cgmp.mpz_get_str(NULL, base, &op._value) + * if c_digits == NULL: # <<<<<<<<<<<<<< + * raise RuntimeError("Error during string conversion.") + * c_digits_alloc = strlen(c_digits) + 1 + */ + } + + /* "mpfr.pyx":114 + * if c_digits == NULL: + * raise RuntimeError("Error during string conversion.") + * c_digits_alloc = strlen(c_digits) + 1 # <<<<<<<<<<<<<< + * + * # It's possible for the conversion from c_digits to digits to raise, so use + */ + __pyx_v_c_digits_alloc = (strlen(__pyx_v_c_digits) + 1); + + /* "mpfr.pyx":118 + * # It's possible for the conversion from c_digits to digits to raise, so use + * # a try-finally block to ensure that c_digits always gets freed. + * try: # <<<<<<<<<<<<<< + * digits = bytes(c_digits) + * finally: + */ + /*try:*/ { + + /* "mpfr.pyx":119 + * # a try-finally block to ensure that c_digits always gets freed. + * try: + * digits = bytes(c_digits) # <<<<<<<<<<<<<< + * finally: + * freefunc(c_digits, c_digits_alloc) + */ + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_c_digits); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 119, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L8_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_digits = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + + /* "mpfr.pyx":121 + * digits = bytes(c_digits) + * finally: + * freefunc(c_digits, c_digits_alloc) # <<<<<<<<<<<<<< + * + * # Return a plain string on Python 2, and a Unicode string on Python 3. + */ + /*finally:*/ { + /*normal exit:*/{ + __pyx_v_freefunc(__pyx_v_c_digits, __pyx_v_c_digits_alloc); + goto __pyx_L9; + } + __pyx_L8_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename; + { + __pyx_v_freefunc(__pyx_v_c_digits, __pyx_v_c_digits_alloc); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13); + } + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10); + __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; + __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7; + goto __pyx_L1_error; + } + __pyx_L9:; + } + + /* "mpfr.pyx":124 + * + * # Return a plain string on Python 2, and a Unicode string on Python 3. + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return digits + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_tuple__4, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 124, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 124, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "mpfr.pyx":125 + * # Return a plain string on Python 2, and a Unicode string on Python 3. + * if sys.version_info < (3,): + * return digits # <<<<<<<<<<<<<< + * else: + * return digits.decode('ascii') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_digits); + __pyx_r = __pyx_v_digits; + goto __pyx_L0; + + /* "mpfr.pyx":124 + * + * # Return a plain string on Python 2, and a Unicode string on Python 3. + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return digits + * else: + */ + } + + /* "mpfr.pyx":127 + * return digits + * else: + * return digits.decode('ascii') # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_decode_bytes(__pyx_v_digits, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "mpfr.pyx":86 + * + * + * def mpz_get_str(int base, Mpz_t op not None): # <<<<<<<<<<<<<< + * """ + * Convert to a string of digits in a given base. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("mpfr.mpz_get_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_digits); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":180 + * + * # Checks for valid parameter ranges + * cdef int check_rounding_mode(cmpfr.mpfr_rnd_t rnd) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given rounding mode is valid. Raise ValueError if not. + */ + +static int __pyx_f_4mpfr_check_rounding_mode(mpfr_rnd_t __pyx_v_rnd) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_rounding_mode", 1); + + /* "mpfr.pyx":185 + * + * """ + * if MPFR_RNDN <= rnd <= MPFR_RNDF: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MPFR_RNDN); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_mpfr_rnd_t(__pyx_v_rnd); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 185, __pyx_L1_error) + if (__Pyx_PyObject_IsTrue(__pyx_t_3)) { + __Pyx_DECREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MPFR_RNDF); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 185, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 185, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(__pyx_t_5)) { + + /* "mpfr.pyx":186 + * """ + * if MPFR_RNDN <= rnd <= MPFR_RNDF: + * return 0 # <<<<<<<<<<<<<< + * else: + * raise ValueError("invalid rounding mode {}".format(rnd)) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "mpfr.pyx":185 + * + * """ + * if MPFR_RNDN <= rnd <= MPFR_RNDF: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + } + + /* "mpfr.pyx":188 + * return 0 + * else: + * raise ValueError("invalid rounding mode {}".format(rnd)) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_rounding_mode, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_From_mpfr_rnd_t(__pyx_v_rnd); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_1}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 188, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 188, __pyx_L1_error) + } + + /* "mpfr.pyx":180 + * + * # Checks for valid parameter ranges + * cdef int check_rounding_mode(cmpfr.mpfr_rnd_t rnd) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given rounding mode is valid. Raise ValueError if not. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("mpfr.check_rounding_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":191 + * + * + * cdef int check_cache_flags(cmpfr.mpfr_free_cache_t flags) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given cache flags are valid. + */ + +static int __pyx_f_4mpfr_check_cache_flags(mpfr_free_cache_t __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_cache_flags", 1); + + /* "mpfr.pyx":198 + * + * """ + * if flags & MPFR_FREE_CACHE_ALL == flags: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + __pyx_t_1 = ((__pyx_v_flags & __pyx_v_4mpfr_MPFR_FREE_CACHE_ALL) == __pyx_v_flags); + if (likely(__pyx_t_1)) { + + /* "mpfr.pyx":199 + * """ + * if flags & MPFR_FREE_CACHE_ALL == flags: + * return 0 # <<<<<<<<<<<<<< + * else: + * raise ValueError("invalid flag mask {}".format(flags)) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "mpfr.pyx":198 + * + * """ + * if flags & MPFR_FREE_CACHE_ALL == flags: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + } + + /* "mpfr.pyx":201 + * return 0 + * else: + * raise ValueError("invalid flag mask {}".format(flags)) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_flag_mask, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_mpfr_free_cache_t(__pyx_v_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 201, __pyx_L1_error) + } + + /* "mpfr.pyx":191 + * + * + * cdef int check_cache_flags(cmpfr.mpfr_free_cache_t flags) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given cache flags are valid. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("mpfr.check_cache_flags", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":204 + * + * + * cdef int check_base(int b, int allow_zero) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given base (for string conversion) is valid. + */ + +static int __pyx_f_4mpfr_check_base(int __pyx_v_b, int __pyx_v_allow_zero) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_base", 1); + + /* "mpfr.pyx":211 + * + * """ + * if allow_zero: # <<<<<<<<<<<<<< + * if 2 <= b <= 62 or b == 0: + * return 0 + */ + __pyx_t_1 = (__pyx_v_allow_zero != 0); + if (__pyx_t_1) { + + /* "mpfr.pyx":212 + * """ + * if allow_zero: + * if 2 <= b <= 62 or b == 0: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + __pyx_t_2 = (2 <= __pyx_v_b); + if (__pyx_t_2) { + __pyx_t_2 = (__pyx_v_b <= 62); + } + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_2 = (__pyx_v_b == 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L5_bool_binop_done:; + if (likely(__pyx_t_1)) { + + /* "mpfr.pyx":213 + * if allow_zero: + * if 2 <= b <= 62 or b == 0: + * return 0 # <<<<<<<<<<<<<< + * else: + * raise ValueError( + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "mpfr.pyx":212 + * """ + * if allow_zero: + * if 2 <= b <= 62 or b == 0: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + } + + /* "mpfr.pyx":215 + * return 0 + * else: + * raise ValueError( # <<<<<<<<<<<<<< + * "base should be zero or in the range 2 to 62 (inclusive)" + * ) + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 215, __pyx_L1_error) + } + + /* "mpfr.pyx":211 + * + * """ + * if allow_zero: # <<<<<<<<<<<<<< + * if 2 <= b <= 62 or b == 0: + * return 0 + */ + } + + /* "mpfr.pyx":219 + * ) + * else: + * if 2 <= b <= 62: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + /*else*/ { + __pyx_t_1 = (2 <= __pyx_v_b); + if (__pyx_t_1) { + __pyx_t_1 = (__pyx_v_b <= 62); + } + if (likely(__pyx_t_1)) { + + /* "mpfr.pyx":220 + * else: + * if 2 <= b <= 62: + * return 0 # <<<<<<<<<<<<<< + * else: + * raise ValueError("base should be in the range 2 to 62 (inclusive)") + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "mpfr.pyx":219 + * ) + * else: + * if 2 <= b <= 62: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + } + + /* "mpfr.pyx":222 + * return 0 + * else: + * raise ValueError("base should be in the range 2 to 62 (inclusive)") # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 222, __pyx_L1_error) + } + } + + /* "mpfr.pyx":204 + * + * + * cdef int check_base(int b, int allow_zero) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given base (for string conversion) is valid. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("mpfr.check_base", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":225 + * + * + * cdef int check_get_str_n(int b, size_t n) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given number of requested digits is valid + */ + +static int __pyx_f_4mpfr_check_get_str_n(int __pyx_v_b, size_t __pyx_v_n) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_get_str_n", 1); + + /* "mpfr.pyx":233 + * + * """ + * if n == 0 or 2 <= n: # <<<<<<<<<<<<<< + * return 0 + * # Undocumented MPFR feature: mpfr_get_str works for n = 1 + */ + __pyx_t_2 = (__pyx_v_n == 0); + if (!__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_2 = (2 <= __pyx_v_n); + __pyx_t_1 = __pyx_t_2; + __pyx_L4_bool_binop_done:; + if (__pyx_t_1) { + + /* "mpfr.pyx":234 + * """ + * if n == 0 or 2 <= n: + * return 0 # <<<<<<<<<<<<<< + * # Undocumented MPFR feature: mpfr_get_str works for n = 1 + * # in non-power-of-two bases. See comments in vasprintf.c and + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "mpfr.pyx":233 + * + * """ + * if n == 0 or 2 <= n: # <<<<<<<<<<<<<< + * return 0 + * # Undocumented MPFR feature: mpfr_get_str works for n = 1 + */ + } + + /* "mpfr.pyx":238 + * # in non-power-of-two bases. See comments in vasprintf.c and + * # get_str.c. + * if n == 1 and (b & (b-1) != 0): # <<<<<<<<<<<<<< + * return 0 + * raise ValueError("n should be either 0 or at least 2") + */ + __pyx_t_2 = (__pyx_v_n == 1); + if (__pyx_t_2) { + } else { + __pyx_t_1 = __pyx_t_2; + goto __pyx_L7_bool_binop_done; + } + __pyx_t_2 = ((__pyx_v_b & (__pyx_v_b - 1)) != 0); + __pyx_t_1 = __pyx_t_2; + __pyx_L7_bool_binop_done:; + if (__pyx_t_1) { + + /* "mpfr.pyx":239 + * # get_str.c. + * if n == 1 and (b & (b-1) != 0): + * return 0 # <<<<<<<<<<<<<< + * raise ValueError("n should be either 0 or at least 2") + * + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "mpfr.pyx":238 + * # in non-power-of-two bases. See comments in vasprintf.c and + * # get_str.c. + * if n == 1 and (b & (b-1) != 0): # <<<<<<<<<<<<<< + * return 0 + * raise ValueError("n should be either 0 or at least 2") + */ + } + + /* "mpfr.pyx":240 + * if n == 1 and (b & (b-1) != 0): + * return 0 + * raise ValueError("n should be either 0 or at least 2") # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 240, __pyx_L1_error) + + /* "mpfr.pyx":225 + * + * + * cdef int check_get_str_n(int b, size_t n) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given number of requested digits is valid + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("mpfr.check_get_str_n", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":243 + * + * + * cdef int check_precision(cmpfr.mpfr_prec_t precision) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given precision is valid. Raise ValueError if not. + */ + +static int __pyx_f_4mpfr_check_precision(mpfr_prec_t __pyx_v_precision) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_precision", 1); + + /* "mpfr.pyx":248 + * + * """ + * if MPFR_PREC_MIN <= precision <= MPFR_PREC_MAX: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MPFR_PREC_MIN); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_mpfr_prec_t(__pyx_v_precision); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) + if (__Pyx_PyObject_IsTrue(__pyx_t_3)) { + __Pyx_DECREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MPFR_PREC_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(1, 248, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(__pyx_t_5)) { + + /* "mpfr.pyx":249 + * """ + * if MPFR_PREC_MIN <= precision <= MPFR_PREC_MAX: + * return 0 # <<<<<<<<<<<<<< + * else: + * raise ValueError( + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "mpfr.pyx":248 + * + * """ + * if MPFR_PREC_MIN <= precision <= MPFR_PREC_MAX: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + } + + /* "mpfr.pyx":251 + * return 0 + * else: + * raise ValueError( # <<<<<<<<<<<<<< + * "precision should be between {} and {}".format( + * MPFR_PREC_MIN, MPFR_PREC_MAX + */ + /*else*/ { + + /* "mpfr.pyx":252 + * else: + * raise ValueError( + * "precision should be between {} and {}".format( # <<<<<<<<<<<<<< + * MPFR_PREC_MIN, MPFR_PREC_MAX + * ) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_precision_should_be_between_and, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "mpfr.pyx":253 + * raise ValueError( + * "precision should be between {} and {}".format( + * MPFR_PREC_MIN, MPFR_PREC_MAX # <<<<<<<<<<<<<< + * ) + * ) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MPFR_PREC_MIN); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MPFR_PREC_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 253, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + + /* "mpfr.pyx":251 + * return 0 + * else: + * raise ValueError( # <<<<<<<<<<<<<< + * "precision should be between {} and {}".format( + * MPFR_PREC_MIN, MPFR_PREC_MAX + */ + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 251, __pyx_L1_error) + } + + /* "mpfr.pyx":243 + * + * + * cdef int check_precision(cmpfr.mpfr_prec_t precision) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given precision is valid. Raise ValueError if not. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("mpfr.check_precision", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":258 + * + * + * cdef int check_initialized(Mpfr_t x) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given Mpfr_t x instance has been initialized. + */ + +static int __pyx_f_4mpfr_check_initialized(struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_initialized", 1); + + /* "mpfr.pyx":265 + * + * """ + * if not cmpfr_initialized_p(&x._value): # <<<<<<<<<<<<<< + * raise ValueError( + * "Mpfr_t instance {} should be initialized before use".format(x) + */ + __pyx_t_1 = __pyx_f_4mpfr_cmpfr_initialized_p((&__pyx_v_x->_value)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 265, __pyx_L1_error) + __pyx_t_2 = (!(__pyx_t_1 != 0)); + if (unlikely(__pyx_t_2)) { + + /* "mpfr.pyx":267 + * if not cmpfr_initialized_p(&x._value): + * raise ValueError( + * "Mpfr_t instance {} should be initialized before use".format(x) # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Mpfr_t_instance_should_be_initia, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_1 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_1 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_x)}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 267, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "mpfr.pyx":266 + * """ + * if not cmpfr_initialized_p(&x._value): + * raise ValueError( # <<<<<<<<<<<<<< + * "Mpfr_t instance {} should be initialized before use".format(x) + * ) + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 266, __pyx_L1_error) + + /* "mpfr.pyx":265 + * + * """ + * if not cmpfr_initialized_p(&x._value): # <<<<<<<<<<<<<< + * raise ValueError( + * "Mpfr_t instance {} should be initialized before use".format(x) + */ + } + + /* "mpfr.pyx":258 + * + * + * cdef int check_initialized(Mpfr_t x) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given Mpfr_t x instance has been initialized. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("mpfr.check_initialized", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":271 + * + * + * cdef int check_not_initialized(Mpfr_t x) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given Mpfr_t x instance has *not* been initialized. + */ + +static int __pyx_f_4mpfr_check_not_initialized(struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x) { + int __pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_not_initialized", 1); + + /* "mpfr.pyx":279 + * + * """ + * if cmpfr_initialized_p(&x._value): # <<<<<<<<<<<<<< + * raise ValueError( + * "Mpfr_t instance {} is already initialized.".format(x) + */ + __pyx_t_1 = __pyx_f_4mpfr_cmpfr_initialized_p((&__pyx_v_x->_value)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 279, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (unlikely(__pyx_t_2)) { + + /* "mpfr.pyx":281 + * if cmpfr_initialized_p(&x._value): + * raise ValueError( + * "Mpfr_t instance {} is already initialized.".format(x) # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Mpfr_t_instance_is_already_initi, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_1 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_1 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_v_x)}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_1, 1+__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 281, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + + /* "mpfr.pyx":280 + * """ + * if cmpfr_initialized_p(&x._value): + * raise ValueError( # <<<<<<<<<<<<<< + * "Mpfr_t instance {} is already initialized.".format(x) + * ) + */ + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __PYX_ERR(1, 280, __pyx_L1_error) + + /* "mpfr.pyx":279 + * + * """ + * if cmpfr_initialized_p(&x._value): # <<<<<<<<<<<<<< + * raise ValueError( + * "Mpfr_t instance {} is already initialized.".format(x) + */ + } + + /* "mpfr.pyx":271 + * + * + * cdef int check_not_initialized(Mpfr_t x) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given Mpfr_t x instance has *not* been initialized. + */ + + /* function exit code */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("mpfr.check_not_initialized", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":285 + * + * + * cdef int check_flag_mask(cmpfr.mpfr_flags_t flags) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given flag mask is valid. Raise ValueError if not. + */ + +static int __pyx_f_4mpfr_check_flag_mask(mpfr_flags_t __pyx_v_flags) { + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("check_flag_mask", 1); + + /* "mpfr.pyx":290 + * + * """ + * if flags & MPFR_FLAGS_ALL == flags: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + __pyx_t_1 = __Pyx_PyInt_From_mpfr_flags_t(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MPFR_FLAGS_ALL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_And(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_From_mpfr_flags_t(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 290, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (likely(__pyx_t_4)) { + + /* "mpfr.pyx":291 + * """ + * if flags & MPFR_FLAGS_ALL == flags: + * return 0 # <<<<<<<<<<<<<< + * else: + * raise ValueError("flag mask {} contains invalid flags".format(flags)) + */ + __pyx_r = 0; + goto __pyx_L0; + + /* "mpfr.pyx":290 + * + * """ + * if flags & MPFR_FLAGS_ALL == flags: # <<<<<<<<<<<<<< + * return 0 + * else: + */ + } + + /* "mpfr.pyx":293 + * return 0 + * else: + * raise ValueError("flag mask {} contains invalid flags".format(flags)) # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_flag_mask_contains_invalid_flags, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_mpfr_flags_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 293, __pyx_L1_error) + } + + /* "mpfr.pyx":285 + * + * + * cdef int check_flag_mask(cmpfr.mpfr_flags_t flags) except -1: # <<<<<<<<<<<<<< + * """ + * Check that the given flag mask is valid. Raise ValueError if not. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("mpfr.check_flag_mask", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":296 + * + * + * cdef decode_ternary_pair(int ternary_pair): # <<<<<<<<<<<<<< + * """ + * Decode an encoded pair of ternary values. + */ + +static PyObject *__pyx_f_4mpfr_decode_ternary_pair(int __pyx_v_ternary_pair) { + int __pyx_v_first_ternary; + int __pyx_v_second_ternary; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("decode_ternary_pair", 1); + + /* "mpfr.pyx":308 + * cdef int first_ternary, second_ternary + * + * first_ternary = ternary_pair & 3 # <<<<<<<<<<<<<< + * if first_ternary == 2: + * first_ternary = -1 + */ + __pyx_v_first_ternary = (__pyx_v_ternary_pair & 3); + + /* "mpfr.pyx":309 + * + * first_ternary = ternary_pair & 3 + * if first_ternary == 2: # <<<<<<<<<<<<<< + * first_ternary = -1 + * second_ternary = ternary_pair >> 2 + */ + __pyx_t_1 = (__pyx_v_first_ternary == 2); + if (__pyx_t_1) { + + /* "mpfr.pyx":310 + * first_ternary = ternary_pair & 3 + * if first_ternary == 2: + * first_ternary = -1 # <<<<<<<<<<<<<< + * second_ternary = ternary_pair >> 2 + * if second_ternary == 2: + */ + __pyx_v_first_ternary = -1; + + /* "mpfr.pyx":309 + * + * first_ternary = ternary_pair & 3 + * if first_ternary == 2: # <<<<<<<<<<<<<< + * first_ternary = -1 + * second_ternary = ternary_pair >> 2 + */ + } + + /* "mpfr.pyx":311 + * if first_ternary == 2: + * first_ternary = -1 + * second_ternary = ternary_pair >> 2 # <<<<<<<<<<<<<< + * if second_ternary == 2: + * second_ternary = -1 + */ + __pyx_v_second_ternary = (__pyx_v_ternary_pair >> 2); + + /* "mpfr.pyx":312 + * first_ternary = -1 + * second_ternary = ternary_pair >> 2 + * if second_ternary == 2: # <<<<<<<<<<<<<< + * second_ternary = -1 + * return first_ternary, second_ternary + */ + __pyx_t_1 = (__pyx_v_second_ternary == 2); + if (__pyx_t_1) { + + /* "mpfr.pyx":313 + * second_ternary = ternary_pair >> 2 + * if second_ternary == 2: + * second_ternary = -1 # <<<<<<<<<<<<<< + * return first_ternary, second_ternary + * + */ + __pyx_v_second_ternary = -1; + + /* "mpfr.pyx":312 + * first_ternary = -1 + * second_ternary = ternary_pair >> 2 + * if second_ternary == 2: # <<<<<<<<<<<<<< + * second_ternary = -1 + * return first_ternary, second_ternary + */ + } + + /* "mpfr.pyx":314 + * if second_ternary == 2: + * second_ternary = -1 + * return first_ternary, second_ternary # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_first_ternary); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_second_ternary); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(1, 314, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(1, 314, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":296 + * + * + * cdef decode_ternary_pair(int ternary_pair): # <<<<<<<<<<<<<< + * """ + * Decode an encoded pair of ternary values. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("mpfr.decode_ternary_pair", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":317 + * + * + * cdef int cmpfr_initialized_p(cmpfr.mpfr_ptr op): # <<<<<<<<<<<<<< + * """ + * Return non-zero if op is initialized. Return zero otherwise. + */ + +static int __pyx_f_4mpfr_cmpfr_initialized_p(mpfr_ptr __pyx_v_op) { + int __pyx_r; + + /* "mpfr.pyx":322 + * + * """ + * return op._mpfr_d != NULL # <<<<<<<<<<<<<< + * + * + */ + __pyx_r = (__pyx_v_op->_mpfr_d != NULL); + goto __pyx_L0; + + /* "mpfr.pyx":317 + * + * + * cdef int cmpfr_initialized_p(cmpfr.mpfr_ptr op): # <<<<<<<<<<<<<< + * """ + * Return non-zero if op is initialized. Return zero otherwise. + */ + + /* function exit code */ + __pyx_L0:; + return __pyx_r; +} + +/* "mpfr.pyx":343 + * cdef cmpfr.__mpfr_struct _value + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if cmpfr_initialized_p(&self._value): + * cmpfr.mpfr_clear(&self._value) + */ + +/* Python wrapper */ +static void __pyx_pw_4mpfr_6Mpfr_t_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_4mpfr_6Mpfr_t_1__dealloc__(PyObject *__pyx_v_self) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_pf_4mpfr_6Mpfr_t___dealloc__(((struct __pyx_obj_4mpfr_Mpfr_t *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); +} + +static void __pyx_pf_4mpfr_6Mpfr_t___dealloc__(struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_self) { + int __pyx_t_1; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + + /* "mpfr.pyx":344 + * + * def __dealloc__(self): + * if cmpfr_initialized_p(&self._value): # <<<<<<<<<<<<<< + * cmpfr.mpfr_clear(&self._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_cmpfr_initialized_p((&__pyx_v_self->_value)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L1_error) + __pyx_t_2 = (__pyx_t_1 != 0); + if (__pyx_t_2) { + + /* "mpfr.pyx":345 + * def __dealloc__(self): + * if cmpfr_initialized_p(&self._value): + * cmpfr.mpfr_clear(&self._value) # <<<<<<<<<<<<<< + * + * + */ + mpfr_clear((&__pyx_v_self->_value)); + + /* "mpfr.pyx":344 + * + * def __dealloc__(self): + * if cmpfr_initialized_p(&self._value): # <<<<<<<<<<<<<< + * cmpfr.mpfr_clear(&self._value) + * + */ + } + + /* "mpfr.pyx":343 + * cdef cmpfr.__mpfr_struct _value + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if cmpfr_initialized_p(&self._value): + * cmpfr.mpfr_clear(&self._value) + */ + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_WriteUnraisable("mpfr.Mpfr_t.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; +} + +/* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + * def __setstate_cython__(self, __pyx_state): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_6Mpfr_t_3__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_6Mpfr_t_2__reduce_cython__, "Mpfr_t.__reduce_cython__(self)"); +static PyMethodDef __pyx_mdef_4mpfr_6Mpfr_t_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_6Mpfr_t_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_6Mpfr_t_2__reduce_cython__}; +static PyObject *__pyx_pw_4mpfr_6Mpfr_t_3__reduce_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + if (unlikely(__pyx_nargs > 0)) { + __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; + __pyx_r = __pyx_pf_4mpfr_6Mpfr_t_2__reduce_cython__(((struct __pyx_obj_4mpfr_Mpfr_t *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_6Mpfr_t_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce_cython__", 1); + + /* "(tree fragment)":2 + * def __reduce_cython__(self): + * raise TypeError, "self._value cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__value_cannot_be_converted, 0, 0); + __PYX_ERR(0, 2, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + * def __setstate_cython__(self, __pyx_state): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.Mpfr_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_6Mpfr_t_5__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_6Mpfr_t_4__setstate_cython__, "Mpfr_t.__setstate_cython__(self, __pyx_state)"); +static PyMethodDef __pyx_mdef_4mpfr_6Mpfr_t_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_6Mpfr_t_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_6Mpfr_t_4__setstate_cython__}; +static PyObject *__pyx_pw_4mpfr_6Mpfr_t_5__setstate_cython__(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v___pyx_state = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.Mpfr_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_6Mpfr_t_4__setstate_cython__(((struct __pyx_obj_4mpfr_Mpfr_t *)__pyx_v_self), __pyx_v___pyx_state); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_6Mpfr_t_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setstate_cython__", 1); + + /* "(tree fragment)":4 + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + * def __setstate_cython__(self, __pyx_state): + * raise TypeError, "self._value cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<< + */ + __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__value_cannot_be_converted, 0, 0); + __PYX_ERR(0, 4, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.Mpfr_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":352 + * ############################################################################### + * + * def mpfr_initialized_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op has been initialized. Return False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_5mpfr_initialized_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_4mpfr_initialized_p, "mpfr_initialized_p(Mpfr_t op)\n\n Return True if op has been initialized. Return False otherwise.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_5mpfr_initialized_p = {"mpfr_initialized_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_5mpfr_initialized_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_4mpfr_initialized_p}; +static PyObject *__pyx_pw_4mpfr_5mpfr_initialized_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_initialized_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 352, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_initialized_p") < 0)) __PYX_ERR(1, 352, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_initialized_p", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 352, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_initialized_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 352, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_4mpfr_initialized_p(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_4mpfr_initialized_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_initialized_p", 1); + + /* "mpfr.pyx":357 + * + * """ + * return bool(cmpfr_initialized_p(&op._value)) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_f_4mpfr_cmpfr_initialized_p((&__pyx_v_op->_value)); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 357, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 357, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":352 + * ############################################################################### + * + * def mpfr_initialized_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op has been initialized. Return False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_initialized_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":364 + * ############################################################################### + * + * def mpfr_init2(Mpfr_t x not None, cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Initialize x, set its precision to be prec bits and its value to NaN. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_7mpfr_init2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_6mpfr_init2, "mpfr_init2(Mpfr_t x, mpfr_prec_t prec)\n\n Initialize x, set its precision to be prec bits and its value to NaN.\n\n Normally, a variable should be initialized once only or at least be\n cleared, using mpfr_clear, between initializations. To change the precision\n of a variable which has already been initialized, use mpfr_set_prec. The\n precision prec must be an integer between MPFR_PREC_MIN and MPFR_PREC_MAX\n (otherwise the behavior is undefined).\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_7mpfr_init2 = {"mpfr_init2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_7mpfr_init2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_6mpfr_init2}; +static PyObject *__pyx_pw_4mpfr_7mpfr_init2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + mpfr_prec_t __pyx_v_prec; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_init2 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_prec,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 364, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prec)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 364, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_init2", 1, 2, 2, 1); __PYX_ERR(1, 364, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_init2") < 0)) __PYX_ERR(1, 364, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_prec = __Pyx_PyInt_As_mpfr_prec_t(values[1]); if (unlikely((__pyx_v_prec == ((mpfr_prec_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 364, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_init2", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 364, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_init2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 364, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_6mpfr_init2(__pyx_self, __pyx_v_x, __pyx_v_prec); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_6mpfr_init2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_prec_t __pyx_v_prec) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_init2", 1); + + /* "mpfr.pyx":375 + * + * """ + * check_not_initialized(x) # <<<<<<<<<<<<<< + * check_precision(prec) + * cmpfr.mpfr_init2(&x._value, prec) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_not_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 375, __pyx_L1_error) + + /* "mpfr.pyx":376 + * """ + * check_not_initialized(x) + * check_precision(prec) # <<<<<<<<<<<<<< + * cmpfr.mpfr_init2(&x._value, prec) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_precision(__pyx_v_prec); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 376, __pyx_L1_error) + + /* "mpfr.pyx":377 + * check_not_initialized(x) + * check_precision(prec) + * cmpfr.mpfr_init2(&x._value, prec) # <<<<<<<<<<<<<< + * + * def mpfr_inits2(cmpfr.mpfr_prec_t prec, *args): + */ + mpfr_init2((&__pyx_v_x->_value), __pyx_v_prec); + + /* "mpfr.pyx":364 + * ############################################################################### + * + * def mpfr_init2(Mpfr_t x not None, cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Initialize x, set its precision to be prec bits and its value to NaN. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_init2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":379 + * cmpfr.mpfr_init2(&x._value, prec) + * + * def mpfr_inits2(cmpfr.mpfr_prec_t prec, *args): # <<<<<<<<<<<<<< + * """ + * Initialize each of the variables in args: set its precision to prec bits + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_9mpfr_inits2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_8mpfr_inits2, "mpfr_inits2(mpfr_prec_t prec, *args)\n\n Initialize each of the variables in args: set its precision to prec bits\n and its value to NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_9mpfr_inits2 = {"mpfr_inits2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_9mpfr_inits2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_8mpfr_inits2}; +static PyObject *__pyx_pw_4mpfr_9mpfr_inits2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + mpfr_prec_t __pyx_v_prec; + PyObject *__pyx_v_args = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_inits2 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + __pyx_v_args = __Pyx_ArgsSlice_FASTCALL(__pyx_args, 1, __pyx_nargs); + if (unlikely(!__pyx_v_args)) { + __Pyx_RefNannyFinishContext(); + return NULL; + } + __Pyx_GOTREF(__pyx_v_args); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prec,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + default: + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prec)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 379, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "mpfr_inits2") < 0)) __PYX_ERR(1, 379, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs < 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_prec = __Pyx_PyInt_As_mpfr_prec_t(values[0]); if (unlikely((__pyx_v_prec == ((mpfr_prec_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 379, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_inits2", 0, 1, 1, __pyx_nargs); __PYX_ERR(1, 379, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0; + __Pyx_AddTraceback("mpfr.mpfr_inits2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_8mpfr_inits2(__pyx_self, __pyx_v_prec, __pyx_v_args); + + /* function exit code */ + __Pyx_DECREF(__pyx_v_args); + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_8mpfr_inits2(CYTHON_UNUSED PyObject *__pyx_self, mpfr_prec_t __pyx_v_prec, PyObject *__pyx_v_args) { + PyObject *__pyx_v_arg = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_inits2", 1); + + /* "mpfr.pyx":385 + * + * """ + * check_precision(prec) # <<<<<<<<<<<<<< + * for arg in args: + * mpfr_init2(arg, prec) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_precision(__pyx_v_prec); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 385, __pyx_L1_error) + + /* "mpfr.pyx":386 + * """ + * check_precision(prec) + * for arg in args: # <<<<<<<<<<<<<< + * mpfr_init2(arg, prec) + * + */ + __pyx_t_2 = __pyx_v_args; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 386, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 386, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_4); + __pyx_t_4 = 0; + + /* "mpfr.pyx":387 + * check_precision(prec) + * for arg in args: + * mpfr_init2(arg, prec) # <<<<<<<<<<<<<< + * + * def mpfr_clear(Mpfr_t x not None): + */ + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_mpfr_init2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyInt_From_mpfr_prec_t(__pyx_v_prec); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_1 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_1 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_arg, __pyx_t_6}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_1, 2+__pyx_t_1); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 387, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":386 + * """ + * check_precision(prec) + * for arg in args: # <<<<<<<<<<<<<< + * mpfr_init2(arg, prec) + * + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":379 + * cmpfr.mpfr_init2(&x._value, prec) + * + * def mpfr_inits2(cmpfr.mpfr_prec_t prec, *args): # <<<<<<<<<<<<<< + * """ + * Initialize each of the variables in args: set its precision to prec bits + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("mpfr.mpfr_inits2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":389 + * mpfr_init2(arg, prec) + * + * def mpfr_clear(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Free the space occupied by the significand of x. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_11mpfr_clear(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_10mpfr_clear, "mpfr_clear(Mpfr_t x)\n\n Free the space occupied by the significand of x.\n\n It's not usually necessary to call this function directly: it will be\n called automatically when x is garbage-collected.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_11mpfr_clear = {"mpfr_clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_11mpfr_clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_10mpfr_clear}; +static PyObject *__pyx_pw_4mpfr_11mpfr_clear(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 389, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_clear") < 0)) __PYX_ERR(1, 389, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_clear", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 389, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_clear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 389, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_10mpfr_clear(__pyx_self, __pyx_v_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_10mpfr_clear(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_clear", 1); + + /* "mpfr.pyx":397 + * + * """ + * check_initialized(x) # <<<<<<<<<<<<<< + * cmpfr.mpfr_clear(&x._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 397, __pyx_L1_error) + + /* "mpfr.pyx":398 + * """ + * check_initialized(x) + * cmpfr.mpfr_clear(&x._value) # <<<<<<<<<<<<<< + * + * def mpfr_clears(*args): + */ + mpfr_clear((&__pyx_v_x->_value)); + + /* "mpfr.pyx":389 + * mpfr_init2(arg, prec) + * + * def mpfr_clear(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Free the space occupied by the significand of x. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_clear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":400 + * cmpfr.mpfr_clear(&x._value) + * + * def mpfr_clears(*args): # <<<<<<<<<<<<<< + * """ + * Free the space occupied by each of the variables in args. See mpfr_clear + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_13mpfr_clears(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_12mpfr_clears, "mpfr_clears(*args)\n\n Free the space occupied by each of the variables in args. See mpfr_clear\n for more details.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_13mpfr_clears = {"mpfr_clears", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4mpfr_13mpfr_clears, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4mpfr_12mpfr_clears}; +static PyObject *__pyx_pw_4mpfr_13mpfr_clears(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clears (wrapper)", 0); + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "mpfr_clears", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_4mpfr_12mpfr_clears(__pyx_self, __pyx_v_args); + + /* function exit code */ + __Pyx_DECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_12mpfr_clears(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args) { + PyObject *__pyx_v_arg = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_clears", 1); + + /* "mpfr.pyx":406 + * + * """ + * for arg in args: # <<<<<<<<<<<<<< + * mpfr_clear(arg) + * + */ + __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 406, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 406, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_3); + __pyx_t_3 = 0; + + /* "mpfr.pyx":407 + * """ + * for arg in args: + * mpfr_clear(arg) # <<<<<<<<<<<<<< + * + * def mpfr_init(Mpfr_t x not None): + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_mpfr_clear); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_arg}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mpfr.pyx":406 + * + * """ + * for arg in args: # <<<<<<<<<<<<<< + * mpfr_clear(arg) + * + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mpfr.pyx":400 + * cmpfr.mpfr_clear(&x._value) + * + * def mpfr_clears(*args): # <<<<<<<<<<<<<< + * """ + * Free the space occupied by each of the variables in args. See mpfr_clear + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("mpfr.mpfr_clears", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":409 + * mpfr_clear(arg) + * + * def mpfr_init(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Initialize x, set its precision to the default precision, and set its value + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_15mpfr_init(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_14mpfr_init, "mpfr_init(Mpfr_t x)\n\n Initialize x, set its precision to the default precision, and set its value\n to NaN. The default precision can be changed by a call to\n mpfr_set_default_prec.\n\n Warning! In a given program, some other libraries might change the default\n precision and not restore it. Thus it is safer to use mpfr_init2.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_15mpfr_init = {"mpfr_init", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_15mpfr_init, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_14mpfr_init}; +static PyObject *__pyx_pw_4mpfr_15mpfr_init(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_init (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 409, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_init") < 0)) __PYX_ERR(1, 409, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_init", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 409, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_init", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 409, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_14mpfr_init(__pyx_self, __pyx_v_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_14mpfr_init(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_init", 1); + + /* "mpfr.pyx":419 + * + * """ + * check_not_initialized(x) # <<<<<<<<<<<<<< + * cmpfr.mpfr_init(&x._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_not_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 419, __pyx_L1_error) + + /* "mpfr.pyx":420 + * """ + * check_not_initialized(x) + * cmpfr.mpfr_init(&x._value) # <<<<<<<<<<<<<< + * + * def mpfr_inits(*args): + */ + mpfr_init((&__pyx_v_x->_value)); + + /* "mpfr.pyx":409 + * mpfr_clear(arg) + * + * def mpfr_init(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Initialize x, set its precision to the default precision, and set its value + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_init", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":422 + * cmpfr.mpfr_init(&x._value) + * + * def mpfr_inits(*args): # <<<<<<<<<<<<<< + * """ + * Initialize each of the variables in args: set its precision to the default + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_17mpfr_inits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_16mpfr_inits, "mpfr_inits(*args)\n\n Initialize each of the variables in args: set its precision to the default\n precision, and set its value to NaN. The default precision can be changed\n by a call to mpfr_set_default_prec.\n\n Warning! In a given program, some other libraries might change the default\n precision and not restore it. Thus it is safer to use mpfr_inits2.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_17mpfr_inits = {"mpfr_inits", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4mpfr_17mpfr_inits, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4mpfr_16mpfr_inits}; +static PyObject *__pyx_pw_4mpfr_17mpfr_inits(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_args = 0; + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_inits (wrapper)", 0); + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "mpfr_inits", 0))) return NULL; + __Pyx_INCREF(__pyx_args); + __pyx_v_args = __pyx_args; + __pyx_r = __pyx_pf_4mpfr_16mpfr_inits(__pyx_self, __pyx_v_args); + + /* function exit code */ + __Pyx_DECREF(__pyx_v_args); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_16mpfr_inits(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args) { + PyObject *__pyx_v_arg = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_inits", 1); + + /* "mpfr.pyx":432 + * + * """ + * for arg in args: # <<<<<<<<<<<<<< + * mpfr_init(arg) + * + */ + __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 432, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(1, 432, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_3); + __pyx_t_3 = 0; + + /* "mpfr.pyx":433 + * """ + * for arg in args: + * mpfr_init(arg) # <<<<<<<<<<<<<< + * + * def mpfr_set_default_prec(cmpfr.mpfr_prec_t prec): + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_mpfr_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_arg}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 433, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mpfr.pyx":432 + * + * """ + * for arg in args: # <<<<<<<<<<<<<< + * mpfr_init(arg) + * + */ + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mpfr.pyx":422 + * cmpfr.mpfr_init(&x._value) + * + * def mpfr_inits(*args): # <<<<<<<<<<<<<< + * """ + * Initialize each of the variables in args: set its precision to the default + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("mpfr.mpfr_inits", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_arg); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":435 + * mpfr_init(arg) + * + * def mpfr_set_default_prec(cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Set the default precision to be exactly prec bits. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_19mpfr_set_default_prec(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_18mpfr_set_default_prec, "mpfr_set_default_prec(mpfr_prec_t prec)\n\n Set the default precision to be exactly prec bits.\n\n prec can be any integer between MPFR_PREC_MIN and MPFR_PREC_MAX. The\n precision of a variable means the number of bits used to store its\n significand. All subsequent calls to mpfr_init or mpfr_inits will use this\n precision, but previously initialized variables are unaffected. The default\n precision is set to 53 bits initially.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_19mpfr_set_default_prec = {"mpfr_set_default_prec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_19mpfr_set_default_prec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_18mpfr_set_default_prec}; +static PyObject *__pyx_pw_4mpfr_19mpfr_set_default_prec(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + mpfr_prec_t __pyx_v_prec; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_default_prec (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prec,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prec)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 435, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_default_prec") < 0)) __PYX_ERR(1, 435, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_prec = __Pyx_PyInt_As_mpfr_prec_t(values[0]); if (unlikely((__pyx_v_prec == ((mpfr_prec_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 435, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_default_prec", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 435, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_default_prec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_18mpfr_set_default_prec(__pyx_self, __pyx_v_prec); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_18mpfr_set_default_prec(CYTHON_UNUSED PyObject *__pyx_self, mpfr_prec_t __pyx_v_prec) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_default_prec", 1); + + /* "mpfr.pyx":446 + * + * """ + * check_precision(prec) # <<<<<<<<<<<<<< + * cmpfr.mpfr_set_default_prec(prec) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_precision(__pyx_v_prec); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 446, __pyx_L1_error) + + /* "mpfr.pyx":447 + * """ + * check_precision(prec) + * cmpfr.mpfr_set_default_prec(prec) # <<<<<<<<<<<<<< + * + * def mpfr_get_default_prec(): + */ + mpfr_set_default_prec(__pyx_v_prec); + + /* "mpfr.pyx":435 + * mpfr_init(arg) + * + * def mpfr_set_default_prec(cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Set the default precision to be exactly prec bits. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_set_default_prec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":449 + * cmpfr.mpfr_set_default_prec(prec) + * + * def mpfr_get_default_prec(): # <<<<<<<<<<<<<< + * """ + * Return the current default MPFR precision in bits. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_21mpfr_get_default_prec(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_20mpfr_get_default_prec, "mpfr_get_default_prec()\n\n Return the current default MPFR precision in bits.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_21mpfr_get_default_prec = {"mpfr_get_default_prec", (PyCFunction)__pyx_pw_4mpfr_21mpfr_get_default_prec, METH_NOARGS, __pyx_doc_4mpfr_20mpfr_get_default_prec}; +static PyObject *__pyx_pw_4mpfr_21mpfr_get_default_prec(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_default_prec (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_20mpfr_get_default_prec(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_20mpfr_get_default_prec(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_default_prec", 1); + + /* "mpfr.pyx":454 + * + * """ + * return cmpfr.mpfr_get_default_prec() # <<<<<<<<<<<<<< + * + * def mpfr_set_prec(Mpfr_t x not None, cmpfr.mpfr_prec_t prec): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_mpfr_prec_t(mpfr_get_default_prec()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":449 + * cmpfr.mpfr_set_default_prec(prec) + * + * def mpfr_get_default_prec(): # <<<<<<<<<<<<<< + * """ + * Return the current default MPFR precision in bits. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_get_default_prec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":456 + * return cmpfr.mpfr_get_default_prec() + * + * def mpfr_set_prec(Mpfr_t x not None, cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Reset precision of x. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_23mpfr_set_prec(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_22mpfr_set_prec, "mpfr_set_prec(Mpfr_t x, mpfr_prec_t prec)\n\n Reset precision of x.\n\n Reset the precision of x to be exactly prec bits, and set its value to\n NaN. The previous value stored in x is lost. It is equivalent to a call to\n mpfr_clear(x) followed by a call to mpfr_init2(x, prec), but more efficient\n as no allocation is done in case the current allocated space for the\n significand of x is enough. The precision prec can be any integer between\n MPFR_PREC_MIN and MPFR_PREC_MAX. In case you want to keep the previous\n value stored in x, use mpfr_prec_round instead.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_23mpfr_set_prec = {"mpfr_set_prec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_23mpfr_set_prec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_22mpfr_set_prec}; +static PyObject *__pyx_pw_4mpfr_23mpfr_set_prec(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + mpfr_prec_t __pyx_v_prec; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_prec (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_prec,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 456, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prec)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 456, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_prec", 1, 2, 2, 1); __PYX_ERR(1, 456, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_prec") < 0)) __PYX_ERR(1, 456, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_prec = __Pyx_PyInt_As_mpfr_prec_t(values[1]); if (unlikely((__pyx_v_prec == ((mpfr_prec_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 456, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_prec", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 456, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_prec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 456, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_22mpfr_set_prec(__pyx_self, __pyx_v_x, __pyx_v_prec); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_22mpfr_set_prec(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_prec_t __pyx_v_prec) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_prec", 1); + + /* "mpfr.pyx":469 + * + * """ + * check_initialized(x) # <<<<<<<<<<<<<< + * check_precision(prec) + * cmpfr.mpfr_set_prec(&x._value, prec) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 469, __pyx_L1_error) + + /* "mpfr.pyx":470 + * """ + * check_initialized(x) + * check_precision(prec) # <<<<<<<<<<<<<< + * cmpfr.mpfr_set_prec(&x._value, prec) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_precision(__pyx_v_prec); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 470, __pyx_L1_error) + + /* "mpfr.pyx":471 + * check_initialized(x) + * check_precision(prec) + * cmpfr.mpfr_set_prec(&x._value, prec) # <<<<<<<<<<<<<< + * + * def mpfr_get_prec(Mpfr_t x not None): + */ + mpfr_set_prec((&__pyx_v_x->_value), __pyx_v_prec); + + /* "mpfr.pyx":456 + * return cmpfr.mpfr_get_default_prec() + * + * def mpfr_set_prec(Mpfr_t x not None, cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Reset precision of x. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_set_prec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":473 + * cmpfr.mpfr_set_prec(&x._value, prec) + * + * def mpfr_get_prec(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Return the precision of x + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_25mpfr_get_prec(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_24mpfr_get_prec, "mpfr_get_prec(Mpfr_t x)\n\n Return the precision of x\n\n Returns the number of bits used to store the significand of x.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_25mpfr_get_prec = {"mpfr_get_prec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_25mpfr_get_prec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_24mpfr_get_prec}; +static PyObject *__pyx_pw_4mpfr_25mpfr_get_prec(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_prec (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 473, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_get_prec") < 0)) __PYX_ERR(1, 473, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_get_prec", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 473, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_get_prec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 473, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_24mpfr_get_prec(__pyx_self, __pyx_v_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_24mpfr_get_prec(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_prec", 1); + + /* "mpfr.pyx":480 + * + * """ + * check_initialized(x) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_get_prec(&x._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 480, __pyx_L1_error) + + /* "mpfr.pyx":481 + * """ + * check_initialized(x) + * return cmpfr.mpfr_get_prec(&x._value) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_mpfr_prec_t(mpfr_get_prec((&__pyx_v_x->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":473 + * cmpfr.mpfr_set_prec(&x._value, prec) + * + * def mpfr_get_prec(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Return the precision of x + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_get_prec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":488 + * ############################################################################### + * + * def mpfr_set(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop from op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_27mpfr_set(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_26mpfr_set, "mpfr_set(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop from op, rounded in the direction rnd.\n\n Set the value of rop from the value of the Mpfr_t object op, rounded toward\n the given direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_27mpfr_set = {"mpfr_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_27mpfr_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_26mpfr_set}; +static PyObject *__pyx_pw_4mpfr_27mpfr_set(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 488, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 488, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set", 1, 3, 3, 1); __PYX_ERR(1, 488, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 488, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set", 1, 3, 3, 2); __PYX_ERR(1, 488, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set") < 0)) __PYX_ERR(1, 488, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 488, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 488, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 488, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 488, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_26mpfr_set(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_26mpfr_set(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set", 1); + + /* "mpfr.pyx":496 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 496, __pyx_L1_error) + + /* "mpfr.pyx":497 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 497, __pyx_L1_error) + + /* "mpfr.pyx":498 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_set(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 498, __pyx_L1_error) + + /* "mpfr.pyx":499 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_set_ui(Mpfr_t rop not None, unsigned long int op, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_set((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 499, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":488 + * ############################################################################### + * + * def mpfr_set(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop from op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":501 + * return cmpfr.mpfr_set(&rop._value, &op._value, rnd) + * + * def mpfr_set_ui(Mpfr_t rop not None, unsigned long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_29mpfr_set_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_28mpfr_set_ui, "mpfr_set_ui(Mpfr_t rop, unsigned long op, mpfr_rnd_t rnd)\n\n Set the value of rop from a nonnegative integer, rounded in direction rnd.\n\n Set the value of rop from op, rounded toward the given direction rnd. op\n should be an integer that's within the range of a C unsigned long. Note\n that the input 0 is converted to +0, regardless of the rounding mode.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_29mpfr_set_ui = {"mpfr_set_ui", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_29mpfr_set_ui, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_28mpfr_set_ui}; +static PyObject *__pyx_pw_4mpfr_29mpfr_set_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + unsigned long __pyx_v_op; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_ui (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 501, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 501, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_ui", 1, 3, 3, 1); __PYX_ERR(1, 501, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 501, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_ui", 1, 3, 3, 2); __PYX_ERR(1, 501, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_ui") < 0)) __PYX_ERR(1, 501, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_op == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(1, 501, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 502, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_ui", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 501, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 501, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_28mpfr_set_ui(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_28mpfr_set_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, unsigned long __pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_ui", 1); + + /* "mpfr.pyx":511 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_ui(&rop._value, op, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 511, __pyx_L1_error) + + /* "mpfr.pyx":512 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_set_ui(&rop._value, op, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 512, __pyx_L1_error) + + /* "mpfr.pyx":513 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_ui(&rop._value, op, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_set_si(Mpfr_t rop not None, long int op, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_set_ui((&__pyx_v_rop->_value), __pyx_v_op, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":501 + * return cmpfr.mpfr_set(&rop._value, &op._value, rnd) + * + * def mpfr_set_ui(Mpfr_t rop not None, unsigned long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_set_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":515 + * return cmpfr.mpfr_set_ui(&rop._value, op, rnd) + * + * def mpfr_set_si(Mpfr_t rop not None, long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from an integer, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_31mpfr_set_si(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_30mpfr_set_si, "mpfr_set_si(Mpfr_t rop, long op, mpfr_rnd_t rnd)\n\n Set the value of rop from an integer, rounded in the direction rnd.\n\n Set the value of rop from op, rounded toward the given direction rnd. op\n should be an integer that's within the range of a C long. Note that the\n input 0 is converted to +0, regardless of the rounding mode.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_31mpfr_set_si = {"mpfr_set_si", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_31mpfr_set_si, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_30mpfr_set_si}; +static PyObject *__pyx_pw_4mpfr_31mpfr_set_si(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + long __pyx_v_op; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_si (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 515, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 515, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_si", 1, 3, 3, 1); __PYX_ERR(1, 515, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 515, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_si", 1, 3, 3, 2); __PYX_ERR(1, 515, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_si") < 0)) __PYX_ERR(1, 515, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_op == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 515, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 515, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_si", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 515, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_si", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 515, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_30mpfr_set_si(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_30mpfr_set_si(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, long __pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_si", 1); + + /* "mpfr.pyx":524 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_si(&rop._value, op, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 524, __pyx_L1_error) + + /* "mpfr.pyx":525 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_set_si(&rop._value, op, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 525, __pyx_L1_error) + + /* "mpfr.pyx":526 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_si(&rop._value, op, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_set_d(Mpfr_t rop not None, double op, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_set_si((&__pyx_v_rop->_value), __pyx_v_op, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 526, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":515 + * return cmpfr.mpfr_set_ui(&rop._value, op, rnd) + * + * def mpfr_set_si(Mpfr_t rop not None, long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from an integer, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_set_si", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":528 + * return cmpfr.mpfr_set_si(&rop._value, op, rnd) + * + * def mpfr_set_d(Mpfr_t rop not None, double op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from a Python float op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_33mpfr_set_d(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_32mpfr_set_d, "mpfr_set_d(Mpfr_t rop, double op, mpfr_rnd_t rnd)\n\n Set the value of rop from a Python float op, rounded in the direction rnd.\n\n Set the value of rop from op, rounded toward the given direction rnd. If\n the system does not support the IEEE 754 standard, mpfr_set_d might not\n preserve the signed zeros.\n\n Note: If you want to store a floating-point constant to an Mpfr_t object, you\n should use mpfr_set_str (or one of the MPFR constant functions, such as\n mpfr_const_pi for Pi) instead of mpfr_set_d. Otherwise the floating-point\n constant will be first converted into a reduced-precision (e.g., 53-bit)\n binary number before MPFR can work with it.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_33mpfr_set_d = {"mpfr_set_d", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_33mpfr_set_d, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_32mpfr_set_d}; +static PyObject *__pyx_pw_4mpfr_33mpfr_set_d(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + double __pyx_v_op; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_d (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 528, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 528, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_d", 1, 3, 3, 1); __PYX_ERR(1, 528, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 528, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_d", 1, 3, 3, 2); __PYX_ERR(1, 528, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_d") < 0)) __PYX_ERR(1, 528, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_op == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 528, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 528, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_d", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 528, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 528, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_32mpfr_set_d(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_32mpfr_set_d(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, double __pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_d", 1); + + /* "mpfr.pyx":543 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_d(&rop._value, op, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 543, __pyx_L1_error) + + /* "mpfr.pyx":544 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_set_d(&rop._value, op, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 544, __pyx_L1_error) + + /* "mpfr.pyx":545 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_d(&rop._value, op, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_set_z(Mpfr_t rop not None, Mpz_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_set_d((&__pyx_v_rop->_value), __pyx_v_op, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":528 + * return cmpfr.mpfr_set_si(&rop._value, op, rnd) + * + * def mpfr_set_d(Mpfr_t rop not None, double op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from a Python float op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_set_d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":547 + * return cmpfr.mpfr_set_d(&rop._value, op, rnd) + * + * def mpfr_set_z(Mpfr_t rop not None, Mpz_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from a GMP integer op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_35mpfr_set_z(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_34mpfr_set_z, "mpfr_set_z(Mpfr_t rop, Mpz_t op, mpfr_rnd_t rnd)\n\n Set the value of rop from a GMP integer op, rounded in the direction rnd.\n\n Set the value of rop from op, rounded toward the given direction rnd. Note\n that the input 0 is converted to +0, regardless of the rounding mode.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_35mpfr_set_z = {"mpfr_set_z", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_35mpfr_set_z, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_34mpfr_set_z}; +static PyObject *__pyx_pw_4mpfr_35mpfr_set_z(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_z (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 547, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 547, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_z", 1, 3, 3, 1); __PYX_ERR(1, 547, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 547, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_z", 1, 3, 3, 2); __PYX_ERR(1, 547, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_z") < 0)) __PYX_ERR(1, 547, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpz_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 547, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_z", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 547, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_z", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 547, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpz_t, 0, "op", 0))) __PYX_ERR(1, 547, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_34mpfr_set_z(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_34mpfr_set_z(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_z", 1); + + /* "mpfr.pyx":555 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_z(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 555, __pyx_L1_error) + + /* "mpfr.pyx":556 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_set_z(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 556, __pyx_L1_error) + + /* "mpfr.pyx":557 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_z(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_set_ui_2exp(Mpfr_t rop not None, unsigned long int op, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_set_z((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":547 + * return cmpfr.mpfr_set_d(&rop._value, op, rnd) + * + * def mpfr_set_z(Mpfr_t rop not None, Mpz_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from a GMP integer op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_set_z", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":559 + * return cmpfr.mpfr_set_z(&rop._value, &op._value, rnd) + * + * def mpfr_set_ui_2exp(Mpfr_t rop not None, unsigned long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_37mpfr_set_ui_2exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_36mpfr_set_ui_2exp, "mpfr_set_ui_2exp(Mpfr_t rop, unsigned long op, mpfr_exp_t e, mpfr_rnd_t rnd)\n\n Set rop to op multiplied by a power of 2.\n\n Set the value of rop from op multiplied by two to the power e, rounded\n toward the given direction rnd. op must be within the range of a C\n unsigned long. Note that the input 0 is converted to +0.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_37mpfr_set_ui_2exp = {"mpfr_set_ui_2exp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_37mpfr_set_ui_2exp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_36mpfr_set_ui_2exp}; +static PyObject *__pyx_pw_4mpfr_37mpfr_set_ui_2exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + unsigned long __pyx_v_op; + mpfr_exp_t __pyx_v_e; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_ui_2exp (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_e,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 559, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 559, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_ui_2exp", 1, 4, 4, 1); __PYX_ERR(1, 559, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_e)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 559, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_ui_2exp", 1, 4, 4, 2); __PYX_ERR(1, 559, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 559, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_ui_2exp", 1, 4, 4, 3); __PYX_ERR(1, 559, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_ui_2exp") < 0)) __PYX_ERR(1, 559, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_op == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(1, 559, __pyx_L3_error) + __pyx_v_e = __Pyx_PyInt_As_mp_exp_t(values[2]); if (unlikely((__pyx_v_e == ((mpfr_exp_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 560, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 560, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_ui_2exp", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 559, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_ui_2exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 559, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_36mpfr_set_ui_2exp(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_e, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_36mpfr_set_ui_2exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, unsigned long __pyx_v_op, mpfr_exp_t __pyx_v_e, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_ui_2exp", 1); + + /* "mpfr.pyx":569 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_ui_2exp(&rop._value, op, e, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 569, __pyx_L1_error) + + /* "mpfr.pyx":570 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_set_ui_2exp(&rop._value, op, e, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 570, __pyx_L1_error) + + /* "mpfr.pyx":571 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_ui_2exp(&rop._value, op, e, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_set_si_2exp(Mpfr_t rop not None, long int op, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_set_ui_2exp((&__pyx_v_rop->_value), __pyx_v_op, __pyx_v_e, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":559 + * return cmpfr.mpfr_set_z(&rop._value, &op._value, rnd) + * + * def mpfr_set_ui_2exp(Mpfr_t rop not None, unsigned long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_set_ui_2exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":573 + * return cmpfr.mpfr_set_ui_2exp(&rop._value, op, e, rnd) + * + * def mpfr_set_si_2exp(Mpfr_t rop not None, long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_39mpfr_set_si_2exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_38mpfr_set_si_2exp, "mpfr_set_si_2exp(Mpfr_t rop, long op, mpfr_exp_t e, mpfr_rnd_t rnd)\n\n Set rop to op multiplied by a power of 2.\n\n Set the value of rop from op multiplied by two to the power e, rounded\n toward the given direction rnd. op must be within the range of a C long.\n Note that the input 0 is converted to +0.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_39mpfr_set_si_2exp = {"mpfr_set_si_2exp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_39mpfr_set_si_2exp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_38mpfr_set_si_2exp}; +static PyObject *__pyx_pw_4mpfr_39mpfr_set_si_2exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + long __pyx_v_op; + mpfr_exp_t __pyx_v_e; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_si_2exp (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_e,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 573, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 573, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_si_2exp", 1, 4, 4, 1); __PYX_ERR(1, 573, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_e)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 573, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_si_2exp", 1, 4, 4, 2); __PYX_ERR(1, 573, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 573, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_si_2exp", 1, 4, 4, 3); __PYX_ERR(1, 573, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_si_2exp") < 0)) __PYX_ERR(1, 573, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_op == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 573, __pyx_L3_error) + __pyx_v_e = __Pyx_PyInt_As_mp_exp_t(values[2]); if (unlikely((__pyx_v_e == ((mpfr_exp_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 574, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 574, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_si_2exp", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 573, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_si_2exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 573, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_38mpfr_set_si_2exp(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_e, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_38mpfr_set_si_2exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, long __pyx_v_op, mpfr_exp_t __pyx_v_e, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_si_2exp", 1); + + /* "mpfr.pyx":583 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_si_2exp(&rop._value, op, e, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 583, __pyx_L1_error) + + /* "mpfr.pyx":584 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_set_si_2exp(&rop._value, op, e, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 584, __pyx_L1_error) + + /* "mpfr.pyx":585 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_si_2exp(&rop._value, op, e, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_set_z_2exp(Mpfr_t rop not None, Mpz_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_set_si_2exp((&__pyx_v_rop->_value), __pyx_v_op, __pyx_v_e, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":573 + * return cmpfr.mpfr_set_ui_2exp(&rop._value, op, e, rnd) + * + * def mpfr_set_si_2exp(Mpfr_t rop not None, long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_set_si_2exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":587 + * return cmpfr.mpfr_set_si_2exp(&rop._value, op, e, rnd) + * + * def mpfr_set_z_2exp(Mpfr_t rop not None, Mpz_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_41mpfr_set_z_2exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_40mpfr_set_z_2exp, "mpfr_set_z_2exp(Mpfr_t rop, Mpz_t op, mpfr_exp_t e, mpfr_rnd_t rnd)\n\n Set rop to op multiplied by a power of 2.\n\n Set the value of rop from op multiplied by two to the power e, rounded\n toward the given direction rnd. Note that the input 0 is converted to +0.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_41mpfr_set_z_2exp = {"mpfr_set_z_2exp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_41mpfr_set_z_2exp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_40mpfr_set_z_2exp}; +static PyObject *__pyx_pw_4mpfr_41mpfr_set_z_2exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_op = 0; + mpfr_exp_t __pyx_v_e; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_z_2exp (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_e,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 587, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 587, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_z_2exp", 1, 4, 4, 1); __PYX_ERR(1, 587, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_e)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 587, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_z_2exp", 1, 4, 4, 2); __PYX_ERR(1, 587, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 587, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_z_2exp", 1, 4, 4, 3); __PYX_ERR(1, 587, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_z_2exp") < 0)) __PYX_ERR(1, 587, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpz_t *)values[1]); + __pyx_v_e = __Pyx_PyInt_As_mp_exp_t(values[2]); if (unlikely((__pyx_v_e == ((mpfr_exp_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 588, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 588, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_z_2exp", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 587, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_z_2exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 587, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpz_t, 0, "op", 0))) __PYX_ERR(1, 587, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_40mpfr_set_z_2exp(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_e, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_40mpfr_set_z_2exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_op, mpfr_exp_t __pyx_v_e, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_z_2exp", 1); + + /* "mpfr.pyx":596 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_z_2exp(&rop._value, &op._value, e, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 596, __pyx_L1_error) + + /* "mpfr.pyx":597 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_set_z_2exp(&rop._value, &op._value, e, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 597, __pyx_L1_error) + + /* "mpfr.pyx":598 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_z_2exp(&rop._value, &op._value, e, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_set_str(Mpfr_t rop not None, object s, int base, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_set_z_2exp((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_e, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":587 + * return cmpfr.mpfr_set_si_2exp(&rop._value, op, e, rnd) + * + * def mpfr_set_z_2exp(Mpfr_t rop not None, Mpz_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_set_z_2exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":600 + * return cmpfr.mpfr_set_z_2exp(&rop._value, &op._value, e, rnd) + * + * def mpfr_set_str(Mpfr_t rop not None, object s, int base, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop from a string s. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_43mpfr_set_str(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_42mpfr_set_str, "mpfr_set_str(Mpfr_t rop, s, int base, mpfr_rnd_t rnd)\n\n Set rop from a string s.\n\n Set rop to the value of the string s in base base, rounded in the direction\n rnd. See the documentation of mpfr_strtofr for a detailed description of\n the valid string formats. Contrary to mpfr_strtofr, mpfr_set_str requires\n the whole string to represent a valid floating-point number. This function\n returns 0 if the entire string up to the final null character is a valid\n number in base base; otherwise it returns \342\210\2221, and rop may have\n changed. Note: it is preferable to use mpfr_strtofr if one wants to\n distinguish between an infinite rop value coming from an infinite s or from\n an overflow.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_43mpfr_set_str = {"mpfr_set_str", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_43mpfr_set_str, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_42mpfr_set_str}; +static PyObject *__pyx_pw_4mpfr_43mpfr_set_str(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + PyObject *__pyx_v_s = 0; + int __pyx_v_base; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_str (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_s,&__pyx_n_s_base,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 600, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 600, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_str", 1, 4, 4, 1); __PYX_ERR(1, 600, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_base)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 600, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_str", 1, 4, 4, 2); __PYX_ERR(1, 600, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 600, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_str", 1, 4, 4, 3); __PYX_ERR(1, 600, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_str") < 0)) __PYX_ERR(1, 600, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_s = values[1]; + __pyx_v_base = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_base == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 600, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 600, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_str", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 600, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 600, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_42mpfr_set_str(__pyx_self, __pyx_v_rop, __pyx_v_s, __pyx_v_base, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_42mpfr_set_str(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, PyObject *__pyx_v_s, int __pyx_v_base, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_v_bytes_s = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + char const *__pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_str", 1); + + /* "mpfr.pyx":616 + * """ + * cdef bytes bytes_s + * bytes_s = s.encode('ascii') # <<<<<<<<<<<<<< + * check_initialized(rop) + * check_base(base, False) + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_ascii}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(1, 616, __pyx_L1_error) + __pyx_v_bytes_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "mpfr.pyx":617 + * cdef bytes bytes_s + * bytes_s = s.encode('ascii') + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_base(base, False) + * check_rounding_mode(rnd) + */ + __pyx_t_4 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 617, __pyx_L1_error) + + /* "mpfr.pyx":618 + * bytes_s = s.encode('ascii') + * check_initialized(rop) + * check_base(base, False) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_str(&rop._value, bytes_s, base, rnd) + */ + __pyx_t_4 = __pyx_f_4mpfr_check_base(__pyx_v_base, 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 618, __pyx_L1_error) + + /* "mpfr.pyx":619 + * check_initialized(rop) + * check_base(base, False) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_set_str(&rop._value, bytes_s, base, rnd) + * + */ + __pyx_t_4 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 619, __pyx_L1_error) + + /* "mpfr.pyx":620 + * check_base(base, False) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_set_str(&rop._value, bytes_s, base, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_strtofr(Mpfr_t rop not None, object s, int base, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + if (unlikely(__pyx_v_bytes_s == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(1, 620, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_bytes_s); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(1, 620, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_set_str((&__pyx_v_rop->_value), __pyx_t_5, __pyx_v_base, __pyx_v_rnd)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":600 + * return cmpfr.mpfr_set_z_2exp(&rop._value, &op._value, e, rnd) + * + * def mpfr_set_str(Mpfr_t rop not None, object s, int base, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop from a string s. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("mpfr.mpfr_set_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_bytes_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":622 + * return cmpfr.mpfr_set_str(&rop._value, bytes_s, base, rnd) + * + * def mpfr_strtofr(Mpfr_t rop not None, object s, int base, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Read a floating-point number from a string. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_45mpfr_strtofr(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_44mpfr_strtofr, "mpfr_strtofr(Mpfr_t rop, s, int base, mpfr_rnd_t rnd)\n\n Read a floating-point number from a string.\n\n Read a floating-point number from a string s in base base, rounded in\n the direction rnd; base must be either 0 (to detect the base, as described\n below) or a number from 2 to 62 (otherwise the behavior is undefined).\n\n If s starts with valid data, the result is stored in rop and the function\n returns a pair (ternary, endindex) where ternary is the usual ternary\n return value and endindex gives the index of the character just after the\n valid data. Otherwise rop is set to zero (for consistency with strtod) and\n endindex is 0.\n\n Parsing follows the standard C strtod function with some extensions. After\n optional leading whitespace, one has a subject sequence consisting of an\n optional sign (+ or -), and either numeric data or special data. The\n subject sequence is defined as the longest initial subsequence of the input\n string, starting with the first non-whitespace character, that is of the\n expected form.\n\n The form of numeric data is a non-empty sequence of significand digits with\n an optional decimal point, and an optional exponent consisting of an\n exponent prefix followed by an optional sign and a non-empty sequence of\n decimal digits. A significand digit is either a decimal digit or a Latin\n letter (62 possible characters), with A = 10, B = 11, ..., Z = 35; case is\n ignored in bases less or equal to 36, in bases larger than 36, a = 36, b =\n 37, ..., z = 61. The value of a significand digit must be strictly less\n than the base. The decimal point can be either the one defined by the\n current locale or the period (the first one is accepted for consistency\n with the C standard and the practice, the second one is accepted to allow\n the programmer to provide MPFR numbers from strings in a way that does not\n depend on the current locale). The exponent pre""fix can be e or E for bases\n up to 10, or @ in any base; it indicates a multiplication by a power of the\n base. In bases 2 and 16, the exponent prefix can also be p or P, in which\n case the exponent, called binary exponent, indicates a multiplication by a\n power of 2 instead of the base (there is a difference only for base 16); in\n base 16 for example 1p2 represents 4 whereas 1@2 represents 256. The value\n of an exponent is always written in base 10.\n\n If the argument base is 0, then the base is automatically detected as\n follows. If the significand starts with 0b or 0B, base 2 is assumed. If the\n significand starts with 0x or 0X, base 16 is assumed. Otherwise base 10 is\n assumed.\n\n Note: The exponent (if present) must contain at least a digit. Otherwise\n the possible exponent prefix and sign are not part of the number (which\n ends with the significand). Similarly, if 0b, 0B, 0x or 0X is not followed\n by a binary/hexadecimal digit, then the subject sequence stops at the\n character 0, thus 0 is read.\n\n Special data (for infinities and NaN) can be @inf@ or\n @nan@(n-char-sequence-opt), and if base <= 16, it can also be infinity,\n inf, nan or nan(n-char-sequence-opt), all case insensitive. A\n n-char-sequence-opt is a possibly empty string containing only digits,\n Latin letters and the underscore (0, 1, 2, ..., 9, a, b, ..., z, A, B, ...,\n Z, _). Note: one has an optional sign for all data, even NaN. For example,\n -@nAn@(This_Is_Not_17) is a valid representation for NaN in base 17.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_45mpfr_strtofr = {"mpfr_strtofr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_45mpfr_strtofr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_44mpfr_strtofr}; +static PyObject *__pyx_pw_4mpfr_45mpfr_strtofr(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + PyObject *__pyx_v_s = 0; + int __pyx_v_base; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_strtofr (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_s,&__pyx_n_s_base,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_strtofr", 1, 4, 4, 1); __PYX_ERR(1, 622, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_base)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_strtofr", 1, 4, 4, 2); __PYX_ERR(1, 622, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_strtofr", 1, 4, 4, 3); __PYX_ERR(1, 622, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_strtofr") < 0)) __PYX_ERR(1, 622, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_s = values[1]; + __pyx_v_base = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_base == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 622, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_strtofr", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 622, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_strtofr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 622, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_44mpfr_strtofr(__pyx_self, __pyx_v_rop, __pyx_v_s, __pyx_v_base, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_44mpfr_strtofr(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, PyObject *__pyx_v_s, int __pyx_v_base, mpfr_rnd_t __pyx_v_rnd) { + char *__pyx_v_endptr; + char *__pyx_v_startptr; + PyObject *__pyx_v_bytes_s = 0; + int __pyx_v_ternary; + ptrdiff_t __pyx_v_endindex; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + char *__pyx_t_5; + char const *__pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_strtofr", 1); + + /* "mpfr.pyx":685 + * cdef char* startptr + * cdef bytes bytes_s + * bytes_s = s.encode('ascii') # <<<<<<<<<<<<<< + * + * startptr = bytes_s + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_ascii}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(1, 685, __pyx_L1_error) + __pyx_v_bytes_s = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "mpfr.pyx":687 + * bytes_s = s.encode('ascii') + * + * startptr = bytes_s # <<<<<<<<<<<<<< + * + * check_initialized(rop) + */ + if (unlikely(__pyx_v_bytes_s == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(1, 687, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_bytes_s); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(1, 687, __pyx_L1_error) + __pyx_v_startptr = __pyx_t_5; + + /* "mpfr.pyx":689 + * startptr = bytes_s + * + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_base(base, True) + * check_rounding_mode(rnd) + */ + __pyx_t_4 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 689, __pyx_L1_error) + + /* "mpfr.pyx":690 + * + * check_initialized(rop) + * check_base(base, True) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * ternary = cmpfr.mpfr_strtofr( + */ + __pyx_t_4 = __pyx_f_4mpfr_check_base(__pyx_v_base, 1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 690, __pyx_L1_error) + + /* "mpfr.pyx":691 + * check_initialized(rop) + * check_base(base, True) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * ternary = cmpfr.mpfr_strtofr( + * &rop._value, + */ + __pyx_t_4 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 691, __pyx_L1_error) + + /* "mpfr.pyx":694 + * ternary = cmpfr.mpfr_strtofr( + * &rop._value, + * bytes_s, # <<<<<<<<<<<<<< + * &endptr, + * base, + */ + if (unlikely(__pyx_v_bytes_s == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(1, 694, __pyx_L1_error) + } + __pyx_t_6 = __Pyx_PyBytes_AsString(__pyx_v_bytes_s); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 694, __pyx_L1_error) + + /* "mpfr.pyx":692 + * check_base(base, True) + * check_rounding_mode(rnd) + * ternary = cmpfr.mpfr_strtofr( # <<<<<<<<<<<<<< + * &rop._value, + * bytes_s, + */ + __pyx_v_ternary = mpfr_strtofr((&__pyx_v_rop->_value), __pyx_t_6, (&__pyx_v_endptr), __pyx_v_base, __pyx_v_rnd); + + /* "mpfr.pyx":699 + * rnd, + * ) + * endindex = endptr - startptr # <<<<<<<<<<<<<< + * return ternary, endindex + * + */ + __pyx_v_endindex = (__pyx_v_endptr - __pyx_v_startptr); + + /* "mpfr.pyx":700 + * ) + * endindex = endptr - startptr + * return ternary, endindex # <<<<<<<<<<<<<< + * + * def mpfr_set_nan(Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ternary); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_From_ptrdiff_t(__pyx_v_endindex); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 700, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 700, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 700, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":622 + * return cmpfr.mpfr_set_str(&rop._value, bytes_s, base, rnd) + * + * def mpfr_strtofr(Mpfr_t rop not None, object s, int base, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Read a floating-point number from a string. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("mpfr.mpfr_strtofr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_bytes_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":702 + * return ternary, endindex + * + * def mpfr_set_nan(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ Set x to a NaN. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_47mpfr_set_nan(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_46mpfr_set_nan, "mpfr_set_nan(Mpfr_t op)\n Set x to a NaN.\n\n Set the variable x to NaN (Not-a-Number). The sign bit of the result is\n unspecified.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_47mpfr_set_nan = {"mpfr_set_nan", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_47mpfr_set_nan, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_46mpfr_set_nan}; +static PyObject *__pyx_pw_4mpfr_47mpfr_set_nan(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_nan (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 702, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_nan") < 0)) __PYX_ERR(1, 702, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_nan", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 702, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_nan", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 702, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_46mpfr_set_nan(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_46mpfr_set_nan(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_nan", 1); + + /* "mpfr.pyx":709 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * cmpfr.mpfr_set_nan(&op._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 709, __pyx_L1_error) + + /* "mpfr.pyx":710 + * """ + * check_initialized(op) + * cmpfr.mpfr_set_nan(&op._value) # <<<<<<<<<<<<<< + * + * def mpfr_set_inf(Mpfr_t op not None, int sign): + */ + mpfr_set_nan((&__pyx_v_op->_value)); + + /* "mpfr.pyx":702 + * return ternary, endindex + * + * def mpfr_set_nan(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ Set x to a NaN. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_set_nan", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":712 + * cmpfr.mpfr_set_nan(&op._value) + * + * def mpfr_set_inf(Mpfr_t op not None, int sign): # <<<<<<<<<<<<<< + * """ Set x to an infinity. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_49mpfr_set_inf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_48mpfr_set_inf, "mpfr_set_inf(Mpfr_t op, int sign)\n Set x to an infinity.\n\n Set the variable x to infinity. x is set to positive infinity if the sign\n is nonnegative, and negative infinity otherwise.\n\n Note the unusual sign convention here: most MPFR functions that deal with\n signs use a nonzero value (or True) to indicate a negative number, and zero\n to indiciate a positive number.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_49mpfr_set_inf = {"mpfr_set_inf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_49mpfr_set_inf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_48mpfr_set_inf}; +static PyObject *__pyx_pw_4mpfr_49mpfr_set_inf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + int __pyx_v_sign; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_inf (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,&__pyx_n_s_sign,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 712, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sign)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 712, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_inf", 1, 2, 2, 1); __PYX_ERR(1, 712, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_inf") < 0)) __PYX_ERR(1, 712, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_sign = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_sign == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 712, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_inf", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 712, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_inf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 712, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_48mpfr_set_inf(__pyx_self, __pyx_v_op, __pyx_v_sign); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_48mpfr_set_inf(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, int __pyx_v_sign) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_inf", 1); + + /* "mpfr.pyx":723 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * cmpfr.mpfr_set_inf(&op._value, sign) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 723, __pyx_L1_error) + + /* "mpfr.pyx":724 + * """ + * check_initialized(op) + * cmpfr.mpfr_set_inf(&op._value, sign) # <<<<<<<<<<<<<< + * + * def mpfr_set_zero(Mpfr_t op not None, int sign): + */ + mpfr_set_inf((&__pyx_v_op->_value), __pyx_v_sign); + + /* "mpfr.pyx":712 + * cmpfr.mpfr_set_nan(&op._value) + * + * def mpfr_set_inf(Mpfr_t op not None, int sign): # <<<<<<<<<<<<<< + * """ Set x to an infinity. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_set_inf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":726 + * cmpfr.mpfr_set_inf(&op._value, sign) + * + * def mpfr_set_zero(Mpfr_t op not None, int sign): # <<<<<<<<<<<<<< + * """ Set x to a zero. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_51mpfr_set_zero(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_50mpfr_set_zero, "mpfr_set_zero(Mpfr_t op, int sign)\n Set x to a zero.\n\n Set the variable x to zero. x is set to positive zero if the sign is\n nonnegative, and negative zero otherwise.\n\n Note the unusual sign convention here: most MPFR functions that deal with\n signs use a nonzero value (or True) to indicate a negative number, and zero\n to indiciate a positive number.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_51mpfr_set_zero = {"mpfr_set_zero", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_51mpfr_set_zero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_50mpfr_set_zero}; +static PyObject *__pyx_pw_4mpfr_51mpfr_set_zero(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + int __pyx_v_sign; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_zero (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,&__pyx_n_s_sign,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 726, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sign)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 726, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_zero", 1, 2, 2, 1); __PYX_ERR(1, 726, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_zero") < 0)) __PYX_ERR(1, 726, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_sign = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_sign == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 726, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_zero", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 726, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_zero", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 726, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_50mpfr_set_zero(__pyx_self, __pyx_v_op, __pyx_v_sign); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_50mpfr_set_zero(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, int __pyx_v_sign) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_zero", 1); + + /* "mpfr.pyx":737 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * cmpfr.mpfr_set_zero(&op._value, sign) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 737, __pyx_L1_error) + + /* "mpfr.pyx":738 + * """ + * check_initialized(op) + * cmpfr.mpfr_set_zero(&op._value, sign) # <<<<<<<<<<<<<< + * + * def mpfr_swap(Mpfr_t x not None, Mpfr_t y not None): + */ + mpfr_set_zero((&__pyx_v_op->_value), __pyx_v_sign); + + /* "mpfr.pyx":726 + * cmpfr.mpfr_set_inf(&op._value, sign) + * + * def mpfr_set_zero(Mpfr_t op not None, int sign): # <<<<<<<<<<<<<< + * """ Set x to a zero. + * + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_set_zero", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":740 + * cmpfr.mpfr_set_zero(&op._value, sign) + * + * def mpfr_swap(Mpfr_t x not None, Mpfr_t y not None): # <<<<<<<<<<<<<< + * """ + * Swap the values of x and y efficiently. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_53mpfr_swap(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_52mpfr_swap, "mpfr_swap(Mpfr_t x, Mpfr_t y)\n\n Swap the values of x and y efficiently.\n\n Warning: the precisions are exchanged too; in case the precisions are\n different, mpfr_swap is thus not equivalent to three mpfr_set calls using a\n third auxiliary variable.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_53mpfr_swap = {"mpfr_swap", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_53mpfr_swap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_52mpfr_swap}; +static PyObject *__pyx_pw_4mpfr_53mpfr_swap(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_swap (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 740, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 740, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_swap", 1, 2, 2, 1); __PYX_ERR(1, 740, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_swap") < 0)) __PYX_ERR(1, 740, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_y = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_swap", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 740, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_swap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 740, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4mpfr_Mpfr_t, 0, "y", 0))) __PYX_ERR(1, 740, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_52mpfr_swap(__pyx_self, __pyx_v_x, __pyx_v_y); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_52mpfr_swap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_swap", 1); + + /* "mpfr.pyx":749 + * + * """ + * check_initialized(x) # <<<<<<<<<<<<<< + * check_initialized(y) + * cmpfr.mpfr_swap(&x._value, &y._value) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 749, __pyx_L1_error) + + /* "mpfr.pyx":750 + * """ + * check_initialized(x) + * check_initialized(y) # <<<<<<<<<<<<<< + * cmpfr.mpfr_swap(&x._value, &y._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_y); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error) + + /* "mpfr.pyx":751 + * check_initialized(x) + * check_initialized(y) + * cmpfr.mpfr_swap(&x._value, &y._value) # <<<<<<<<<<<<<< + * + * + */ + mpfr_swap((&__pyx_v_x->_value), (&__pyx_v_y->_value)); + + /* "mpfr.pyx":740 + * cmpfr.mpfr_set_zero(&op._value, sign) + * + * def mpfr_swap(Mpfr_t x not None, Mpfr_t y not None): # <<<<<<<<<<<<<< + * """ + * Swap the values of x and y efficiently. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_swap", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":758 + * ############################################################################### + * + * def mpfr_get_d(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to a Python float. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_55mpfr_get_d(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_54mpfr_get_d, "mpfr_get_d(Mpfr_t op, mpfr_rnd_t rnd)\n\n Convert op to a Python float.\n\n Convert op to a Python float using the rounding mode rnd. If op is NaN,\n some fixed NaN (either quiet or signaling) or the result of 0.0/0.0 is\n returned. If op is \302\261Inf, an infinity of the same sign or the result of\n \302\2611.0/0.0 is returned. If op is zero, this function returns a zero, trying\n to preserve its sign, if possible.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_55mpfr_get_d = {"mpfr_get_d", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_55mpfr_get_d, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_54mpfr_get_d}; +static PyObject *__pyx_pw_4mpfr_55mpfr_get_d(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_d (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 758, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 758, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_get_d", 1, 2, 2, 1); __PYX_ERR(1, 758, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_get_d") < 0)) __PYX_ERR(1, 758, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 758, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_get_d", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 758, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_get_d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 758, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_54mpfr_get_d(__pyx_self, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_54mpfr_get_d(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_d", 1); + + /* "mpfr.pyx":769 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_get_d(&op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 769, __pyx_L1_error) + + /* "mpfr.pyx":770 + * """ + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_get_d(&op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error) + + /* "mpfr.pyx":771 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_get_d(&op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_get_si(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(mpfr_get_d((&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 771, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":758 + * ############################################################################### + * + * def mpfr_get_d(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to a Python float. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_get_d", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":773 + * return cmpfr.mpfr_get_d(&op._value, rnd) + * + * def mpfr_get_si(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to an integer that's within the range of a C long. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_57mpfr_get_si(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_56mpfr_get_si, "mpfr_get_si(Mpfr_t op, mpfr_rnd_t rnd)\n\n Convert op to an integer that's within the range of a C long.\n\n Convert op to an integer after rounding it with respect to rnd. If op is\n NaN, 0 is returned and the erange flag is set. If op is too big for a\n C long, the function returns the maximum or the minimum representable\n int, depending on the direction of the overflow; the erange flag is set\n too.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_57mpfr_get_si = {"mpfr_get_si", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_57mpfr_get_si, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_56mpfr_get_si}; +static PyObject *__pyx_pw_4mpfr_57mpfr_get_si(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_si (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 773, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 773, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_get_si", 1, 2, 2, 1); __PYX_ERR(1, 773, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_get_si") < 0)) __PYX_ERR(1, 773, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 773, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_get_si", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 773, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_get_si", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 773, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_56mpfr_get_si(__pyx_self, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_56mpfr_get_si(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_si", 1); + + /* "mpfr.pyx":784 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_get_si(&op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 784, __pyx_L1_error) + + /* "mpfr.pyx":785 + * """ + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_get_si(&op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 785, __pyx_L1_error) + + /* "mpfr.pyx":786 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_get_si(&op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_get_ui(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_long(mpfr_get_si((&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 786, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":773 + * return cmpfr.mpfr_get_d(&op._value, rnd) + * + * def mpfr_get_si(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to an integer that's within the range of a C long. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_get_si", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":788 + * return cmpfr.mpfr_get_si(&op._value, rnd) + * + * def mpfr_get_ui(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to an integer that's within the range of a C unsigned long. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_59mpfr_get_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_58mpfr_get_ui, "mpfr_get_ui(Mpfr_t op, mpfr_rnd_t rnd)\n\n Convert op to an integer that's within the range of a C unsigned long.\n\n Convert op to an integer after rounding it with respect to rnd. If op is\n NaN, 0 is returned and the erange flag is set. If op is too big for a\n C unsigned long, the function returns the maximum or the minimum\n representable int, depending on the direction of the overflow; the erange\n flag is set too.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_59mpfr_get_ui = {"mpfr_get_ui", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_59mpfr_get_ui, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_58mpfr_get_ui}; +static PyObject *__pyx_pw_4mpfr_59mpfr_get_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_ui (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 788, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 788, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_get_ui", 1, 2, 2, 1); __PYX_ERR(1, 788, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_get_ui") < 0)) __PYX_ERR(1, 788, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 788, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_get_ui", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 788, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_get_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 788, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_58mpfr_get_ui(__pyx_self, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_58mpfr_get_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_ui", 1); + + /* "mpfr.pyx":799 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_get_ui(&op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 799, __pyx_L1_error) + + /* "mpfr.pyx":800 + * """ + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_get_ui(&op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 800, __pyx_L1_error) + + /* "mpfr.pyx":801 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_get_ui(&op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_get_d_2exp(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_unsigned_long(mpfr_get_ui((&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 801, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":788 + * return cmpfr.mpfr_get_si(&op._value, rnd) + * + * def mpfr_get_ui(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to an integer that's within the range of a C unsigned long. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_get_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":803 + * return cmpfr.mpfr_get_ui(&op._value, rnd) + * + * def mpfr_get_d_2exp(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to a Python float and an exponent. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_61mpfr_get_d_2exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_60mpfr_get_d_2exp, "mpfr_get_d_2exp(Mpfr_t op, mpfr_rnd_t rnd)\n\n Convert op to a Python float and an exponent.\n\n Return a pair (d, exp) consisting of a Python float d and an exponent exp\n such that 0.5<=abs(d)<1 and d times 2 raised to exp equals op rounded to\n double (resp. long double) precision, using the given rounding mode. If op\n is zero, then a zero of the same sign (or an unsigned zero, if the\n implementation does not have signed zeros) is returned, and exp is set to\n 0. If op is NaN or an infinity, then the corresponding double precision\n (resp. long-double precision) value is returned, and exp is undefined.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_61mpfr_get_d_2exp = {"mpfr_get_d_2exp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_61mpfr_get_d_2exp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_60mpfr_get_d_2exp}; +static PyObject *__pyx_pw_4mpfr_61mpfr_get_d_2exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_d_2exp (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 803, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 803, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_get_d_2exp", 1, 2, 2, 1); __PYX_ERR(1, 803, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_get_d_2exp") < 0)) __PYX_ERR(1, 803, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 803, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_get_d_2exp", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 803, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_get_d_2exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 803, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_60mpfr_get_d_2exp(__pyx_self, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_60mpfr_get_d_2exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + long __pyx_v_exp; + double __pyx_v_d; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_d_2exp", 1); + + /* "mpfr.pyx":819 + * cdef double d + * + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * d = cmpfr.mpfr_get_d_2exp(&exp, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 819, __pyx_L1_error) + + /* "mpfr.pyx":820 + * + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * d = cmpfr.mpfr_get_d_2exp(&exp, &op._value, rnd) + * return d, exp + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 820, __pyx_L1_error) + + /* "mpfr.pyx":821 + * check_initialized(op) + * check_rounding_mode(rnd) + * d = cmpfr.mpfr_get_d_2exp(&exp, &op._value, rnd) # <<<<<<<<<<<<<< + * return d, exp + * + */ + __pyx_v_d = mpfr_get_d_2exp((&__pyx_v_exp), (&__pyx_v_op->_value), __pyx_v_rnd); + + /* "mpfr.pyx":822 + * check_rounding_mode(rnd) + * d = cmpfr.mpfr_get_d_2exp(&exp, &op._value, rnd) + * return d, exp # <<<<<<<<<<<<<< + * + * def mpfr_frexp(Mpfr_t y not None, Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_exp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 822, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(1, 822, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(1, 822, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":803 + * return cmpfr.mpfr_get_ui(&op._value, rnd) + * + * def mpfr_get_d_2exp(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to a Python float and an exponent. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("mpfr.mpfr_get_d_2exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":824 + * return d, exp + * + * def mpfr_frexp(Mpfr_t y not None, Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """Decompose 'x' in the form 2**e * y. + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_63mpfr_frexp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_62mpfr_frexp, "mpfr_frexp(Mpfr_t y, Mpfr_t x, mpfr_rnd_t rnd)\nDecompose 'x' in the form 2**e * y.\n\n Find exp and y such that 0.5<=abs(y)<1 and y times 2 raised to exp equals x\n rounded to the precision of y, using the given rounding mode. If x is zero,\n then y is set to a zero of the same sign and exp is set to 0. If x is NaN\n or an infinity, then y is set to the same value and exp is undefined.\n\n Sets y and returns a pair (ternary, exp) where ternary is the usual\n ternary return value indicating in which direction rounding occurred.\n "); +static PyMethodDef __pyx_mdef_4mpfr_63mpfr_frexp = {"mpfr_frexp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_63mpfr_frexp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_62mpfr_frexp}; +static PyObject *__pyx_pw_4mpfr_63mpfr_frexp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_frexp (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_y,&__pyx_n_s_x,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 824, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 824, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_frexp", 1, 3, 3, 1); __PYX_ERR(1, 824, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 824, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_frexp", 1, 3, 3, 2); __PYX_ERR(1, 824, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_frexp") < 0)) __PYX_ERR(1, 824, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_y = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 824, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_frexp", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 824, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_frexp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4mpfr_Mpfr_t, 0, "y", 0))) __PYX_ERR(1, 824, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 824, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_62mpfr_frexp(__pyx_self, __pyx_v_y, __pyx_v_x, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_62mpfr_frexp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_rnd_t __pyx_v_rnd) { + mpfr_exp_t __pyx_v_exp; + int __pyx_v_ternary; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_frexp", 1); + + /* "mpfr.pyx":837 + * cdef cmpfr.mpfr_exp_t exp + * + * check_initialized(y) # <<<<<<<<<<<<<< + * check_initialized(x) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_y); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 837, __pyx_L1_error) + + /* "mpfr.pyx":838 + * + * check_initialized(y) + * check_initialized(x) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * ternary = cmpfr.mpfr_frexp(&exp, &y._value, &x._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error) + + /* "mpfr.pyx":839 + * check_initialized(y) + * check_initialized(x) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * ternary = cmpfr.mpfr_frexp(&exp, &y._value, &x._value, rnd) + * return ternary, exp + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 839, __pyx_L1_error) + + /* "mpfr.pyx":840 + * check_initialized(x) + * check_rounding_mode(rnd) + * ternary = cmpfr.mpfr_frexp(&exp, &y._value, &x._value, rnd) # <<<<<<<<<<<<<< + * return ternary, exp + * + */ + __pyx_v_ternary = mpfr_frexp((&__pyx_v_exp), (&__pyx_v_y->_value), (&__pyx_v_x->_value), __pyx_v_rnd); + + /* "mpfr.pyx":841 + * check_rounding_mode(rnd) + * ternary = cmpfr.mpfr_frexp(&exp, &y._value, &x._value, rnd) + * return ternary, exp # <<<<<<<<<<<<<< + * + * def mpfr_get_z_2exp(Mpz_t rop not None, Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ternary); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_mp_exp_t(__pyx_v_exp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(1, 841, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":824 + * return d, exp + * + * def mpfr_frexp(Mpfr_t y not None, Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """Decompose 'x' in the form 2**e * y. + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("mpfr.mpfr_frexp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":843 + * return ternary, exp + * + * def mpfr_get_z_2exp(Mpz_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Decompose as a product of an integer and a power of two. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_65mpfr_get_z_2exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_64mpfr_get_z_2exp, "mpfr_get_z_2exp(Mpz_t rop, Mpfr_t op)\n\n Decompose as a product of an integer and a power of two.\n\n Put the scaled significand of op (regarded as an integer, with the\n precision of op) into rop, and return the exponent exp (which may be\n outside the current exponent range) such that op exactly equals rop times 2\n raised to the power exp. If op is zero, the minimal exponent emin is\n returned. If op is NaN or an infinity, the erange flag is set, rop is set\n to 0, and the the minimal exponent emin is returned. The returned exponent\n may be less than the minimal exponent emin of MPFR numbers in the current\n exponent range; in case the exponent is not representable in the mpfr_exp_t\n type, the erange flag is set and the minimal value of the mpfr_exp_t type\n is returned.\n "); +static PyMethodDef __pyx_mdef_4mpfr_65mpfr_get_z_2exp = {"mpfr_get_z_2exp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_65mpfr_get_z_2exp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_64mpfr_get_z_2exp}; +static PyObject *__pyx_pw_4mpfr_65mpfr_get_z_2exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_z_2exp (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 843, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 843, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_get_z_2exp", 1, 2, 2, 1); __PYX_ERR(1, 843, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_get_z_2exp") < 0)) __PYX_ERR(1, 843, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpz_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_get_z_2exp", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 843, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_get_z_2exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpz_t, 0, "rop", 0))) __PYX_ERR(1, 843, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 843, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_64mpfr_get_z_2exp(__pyx_self, __pyx_v_rop, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_64mpfr_get_z_2exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + mpfr_exp_t __pyx_v_exponent; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_z_2exp", 1); + + /* "mpfr.pyx":860 + * cdef cmpfr.mpfr_exp_t exp + * + * check_initialized(op) # <<<<<<<<<<<<<< + * + * exponent = cmpfr.mpfr_get_z_2exp(&rop._value, &op._value) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 860, __pyx_L1_error) + + /* "mpfr.pyx":862 + * check_initialized(op) + * + * exponent = cmpfr.mpfr_get_z_2exp(&rop._value, &op._value) # <<<<<<<<<<<<<< + * return exponent + * + */ + __pyx_v_exponent = mpfr_get_z_2exp((&__pyx_v_rop->_value), (&__pyx_v_op->_value)); + + /* "mpfr.pyx":863 + * + * exponent = cmpfr.mpfr_get_z_2exp(&rop._value, &op._value) + * return exponent # <<<<<<<<<<<<<< + * + * def mpfr_get_z(Mpz_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_mp_exp_t(__pyx_v_exponent); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 863, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":843 + * return ternary, exp + * + * def mpfr_get_z_2exp(Mpz_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Decompose as a product of an integer and a power of two. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_get_z_2exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":865 + * return exponent + * + * def mpfr_get_z(Mpz_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert to a GMP integer. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_67mpfr_get_z(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_66mpfr_get_z, "mpfr_get_z(Mpz_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Convert to a GMP integer.\n\n Convert op to a mpz_t, after rounding it with respect to rnd. If op is NaN\n or an infinity, the erange flag is set, rop is set to 0, and 0 is returned.\n Otherwise the return value is zero when rop is equal to op (i.e., when op\n is an integer), positive when it is greater than op, and negative when it\n is smaller than op; moreover, if rop differs from op, i.e., if op is not an\n integer, the inexact flag is set.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_67mpfr_get_z = {"mpfr_get_z", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_67mpfr_get_z, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_66mpfr_get_z}; +static PyObject *__pyx_pw_4mpfr_67mpfr_get_z(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_z (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 865, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 865, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_get_z", 1, 3, 3, 1); __PYX_ERR(1, 865, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 865, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_get_z", 1, 3, 3, 2); __PYX_ERR(1, 865, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_get_z") < 0)) __PYX_ERR(1, 865, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpz_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 865, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_get_z", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 865, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_get_z", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpz_t, 0, "rop", 0))) __PYX_ERR(1, 865, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 865, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_66mpfr_get_z(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_66mpfr_get_z(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpz_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_z", 1); + + /* "mpfr.pyx":877 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_get_z(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 877, __pyx_L1_error) + + /* "mpfr.pyx":878 + * """ + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_get_z(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 878, __pyx_L1_error) + + /* "mpfr.pyx":879 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_get_z(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_get_str(int b, size_t n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_get_z((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":865 + * return exponent + * + * def mpfr_get_z(Mpz_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert to a GMP integer. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_get_z", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":881 + * return cmpfr.mpfr_get_z(&rop._value, &op._value, rnd) + * + * def mpfr_get_str(int b, size_t n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Compute a base 'b' string representation for 'op'. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_69mpfr_get_str(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_68mpfr_get_str, "mpfr_get_str(int b, size_t n, Mpfr_t op, mpfr_rnd_t rnd)\n\n Compute a base 'b' string representation for 'op'.\n\n Convert op to a string of digits in base b, with rounding in the direction\n rnd, where n is either zero (see below) or the number of significant digits\n output in the string; in the latter case, n must be greater or equal to\n 2. The base may vary from 2 to 62. Returns a pair (digits, exp) where\n digits gives the base-b digits of op, and for an ordinary number, exp is\n the exponent (for input 0, the current minimal exponent is written).\n\n The generated string is a fraction, with an implicit radix point\n immediately to the left of the first digit. For example, the number \342\210\2223.1416\n would be returned as (\"\342\210\22231416\", 1). If rnd is to nearest, and op is exactly\n in the middle of two consecutive possible outputs, the one with an even\n significand is chosen, where both significands are considered with the\n exponent of op. Note that for an odd base, this may not correspond to an\n even last digit: for example with 2 digits in base 7, (14) and a half is\n rounded to (15) which is 12 in decimal, (16) and a half is rounded to (20)\n which is 14 in decimal, and (26) and a half is rounded to (26) which is 20\n in decimal.\n\n If n is zero, the number of digits of the significand is chosen large\n enough so that re-reading the printed value with the same precision,\n assuming both output and input use rounding to nearest, will recover the\n original value of op. More precisely, in most cases, the chosen precision\n of str is the minimal precision m depending only on p = PREC(op) and b that\n satisfies the above property, i.e., m = 1 + ceil(p*log(2)/log(b)), with p\n replaced by p\342\210\2221 if b is a power of 2, but in some very rare cases, it might\n be m+1 (the smallest case for bases up to 62 is when p equals 186564318007\n for bases 7 and 49).\n\n ""Space for the digit string is automatically allocated, and freed by Python\n when no longer needed. There's no requirement to free this space manually.\n\n RuntimeError is raised on error.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_69mpfr_get_str = {"mpfr_get_str", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_69mpfr_get_str, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_68mpfr_get_str}; +static PyObject *__pyx_pw_4mpfr_69mpfr_get_str(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + int __pyx_v_b; + size_t __pyx_v_n; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_str (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_n,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 881, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 881, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_get_str", 1, 4, 4, 1); __PYX_ERR(1, 881, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 881, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_get_str", 1, 4, 4, 2); __PYX_ERR(1, 881, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 881, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_get_str", 1, 4, 4, 3); __PYX_ERR(1, 881, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_get_str") < 0)) __PYX_ERR(1, 881, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_b = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_b == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 881, __pyx_L3_error) + __pyx_v_n = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 881, __pyx_L3_error) + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 881, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_get_str", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 881, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_get_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 881, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_68mpfr_get_str(__pyx_self, __pyx_v_b, __pyx_v_n, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_68mpfr_get_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_b, size_t __pyx_v_n, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + mpfr_exp_t __pyx_v_exp; + PyObject *__pyx_v_digits = 0; + char *__pyx_v_c_digits; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + char const *__pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_str", 1); + + /* "mpfr.pyx":923 + * cdef char *c_digits + * + * check_base(b, False) # <<<<<<<<<<<<<< + * check_get_str_n(b, n) + * check_initialized(op) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_base(__pyx_v_b, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 923, __pyx_L1_error) + + /* "mpfr.pyx":924 + * + * check_base(b, False) + * check_get_str_n(b, n) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_get_str_n(__pyx_v_b, __pyx_v_n); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 924, __pyx_L1_error) + + /* "mpfr.pyx":925 + * check_base(b, False) + * check_get_str_n(b, n) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * c_digits = cmpfr.mpfr_get_str(NULL, &exp, b, n, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 925, __pyx_L1_error) + + /* "mpfr.pyx":926 + * check_get_str_n(b, n) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * c_digits = cmpfr.mpfr_get_str(NULL, &exp, b, n, &op._value, rnd) + * if c_digits == NULL: + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 926, __pyx_L1_error) + + /* "mpfr.pyx":927 + * check_initialized(op) + * check_rounding_mode(rnd) + * c_digits = cmpfr.mpfr_get_str(NULL, &exp, b, n, &op._value, rnd) # <<<<<<<<<<<<<< + * if c_digits == NULL: + * raise RuntimeError("Error during string conversion.") + */ + __pyx_v_c_digits = mpfr_get_str(NULL, (&__pyx_v_exp), __pyx_v_b, __pyx_v_n, (&__pyx_v_op->_value), __pyx_v_rnd); + + /* "mpfr.pyx":928 + * check_rounding_mode(rnd) + * c_digits = cmpfr.mpfr_get_str(NULL, &exp, b, n, &op._value, rnd) + * if c_digits == NULL: # <<<<<<<<<<<<<< + * raise RuntimeError("Error during string conversion.") + * + */ + __pyx_t_2 = (__pyx_v_c_digits == NULL); + if (unlikely(__pyx_t_2)) { + + /* "mpfr.pyx":929 + * c_digits = cmpfr.mpfr_get_str(NULL, &exp, b, n, &op._value, rnd) + * if c_digits == NULL: + * raise RuntimeError("Error during string conversion.") # <<<<<<<<<<<<<< + * + * # It's possible for the conversion from c_digits to digits to raise, so use + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 929, __pyx_L1_error) + + /* "mpfr.pyx":928 + * check_rounding_mode(rnd) + * c_digits = cmpfr.mpfr_get_str(NULL, &exp, b, n, &op._value, rnd) + * if c_digits == NULL: # <<<<<<<<<<<<<< + * raise RuntimeError("Error during string conversion.") + * + */ + } + + /* "mpfr.pyx":933 + * # It's possible for the conversion from c_digits to digits to raise, so use + * # a try-finally block to ensure that c_digits always gets freed. + * try: # <<<<<<<<<<<<<< + * digits = bytes(c_digits) + * finally: + */ + /*try:*/ { + + /* "mpfr.pyx":934 + * # a try-finally block to ensure that c_digits always gets freed. + * try: + * digits = bytes(c_digits) # <<<<<<<<<<<<<< + * finally: + * cmpfr.mpfr_free_str(c_digits) + */ + __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_c_digits); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 934, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 934, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_digits = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + } + + /* "mpfr.pyx":936 + * digits = bytes(c_digits) + * finally: + * cmpfr.mpfr_free_str(c_digits) # <<<<<<<<<<<<<< + * + * if sys.version_info < (3,): + */ + /*finally:*/ { + /*normal exit:*/{ + mpfr_free_str(__pyx_v_c_digits); + goto __pyx_L6; + } + __pyx_L5_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_7); + __Pyx_XGOTREF(__pyx_t_8); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __pyx_t_1 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename; + { + mpfr_free_str(__pyx_v_c_digits); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12); + } + __Pyx_XGIVEREF(__pyx_t_7); + __Pyx_XGIVEREF(__pyx_t_8); + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9); + __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; + __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6; + goto __pyx_L1_error; + } + __pyx_L6:; + } + + /* "mpfr.pyx":938 + * cmpfr.mpfr_free_str(c_digits) + * + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return digits, exp + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 938, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 938, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_tuple__4, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 938, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 938, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { + + /* "mpfr.pyx":939 + * + * if sys.version_info < (3,): + * return digits, exp # <<<<<<<<<<<<<< + * else: + * return digits.decode('ascii'), exp + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyInt_From_mp_exp_t(__pyx_v_exp); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 939, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_digits); + __Pyx_GIVEREF(__pyx_v_digits); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_digits)) __PYX_ERR(1, 939, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(1, 939, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":938 + * cmpfr.mpfr_free_str(c_digits) + * + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return digits, exp + * else: + */ + } + + /* "mpfr.pyx":941 + * return digits, exp + * else: + * return digits.decode('ascii'), exp # <<<<<<<<<<<<<< + * + * def mpfr_fits_ulong_p(Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_decode_bytes(__pyx_v_digits, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_mp_exp_t(__pyx_v_exp); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3)) __PYX_ERR(1, 941, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_4)) __PYX_ERR(1, 941, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; + goto __pyx_L0; + } + + /* "mpfr.pyx":881 + * return cmpfr.mpfr_get_z(&rop._value, &op._value, rnd) + * + * def mpfr_get_str(int b, size_t n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Compute a base 'b' string representation for 'op'. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_13); + __Pyx_AddTraceback("mpfr.mpfr_get_str", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_digits); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":943 + * return digits.decode('ascii'), exp + * + * def mpfr_fits_ulong_p(Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return True if op would fit into a C unsigned long int. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_71mpfr_fits_ulong_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_70mpfr_fits_ulong_p, "mpfr_fits_ulong_p(Mpfr_t x, mpfr_rnd_t rnd)\n\n Return True if op would fit into a C unsigned long int.\n\n Return True if op would fit into a C unsigned long int when rounded to an\n integer in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_71mpfr_fits_ulong_p = {"mpfr_fits_ulong_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_71mpfr_fits_ulong_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_70mpfr_fits_ulong_p}; +static PyObject *__pyx_pw_4mpfr_71mpfr_fits_ulong_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_fits_ulong_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 943, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 943, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fits_ulong_p", 1, 2, 2, 1); __PYX_ERR(1, 943, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_fits_ulong_p") < 0)) __PYX_ERR(1, 943, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 943, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_fits_ulong_p", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 943, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_fits_ulong_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 943, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_70mpfr_fits_ulong_p(__pyx_self, __pyx_v_x, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_70mpfr_fits_ulong_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_fits_ulong_p", 1); + + /* "mpfr.pyx":951 + * + * """ + * check_initialized(x) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return bool(cmpfr.mpfr_fits_ulong_p(&x._value, rnd)) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 951, __pyx_L1_error) + + /* "mpfr.pyx":952 + * """ + * check_initialized(x) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_fits_ulong_p(&x._value, rnd)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 952, __pyx_L1_error) + + /* "mpfr.pyx":953 + * check_initialized(x) + * check_rounding_mode(rnd) + * return bool(cmpfr.mpfr_fits_ulong_p(&x._value, rnd)) # <<<<<<<<<<<<<< + * + * def mpfr_fits_slong_p(Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_fits_ulong_p((&__pyx_v_x->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 953, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":943 + * return digits.decode('ascii'), exp + * + * def mpfr_fits_ulong_p(Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return True if op would fit into a C unsigned long int. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_fits_ulong_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":955 + * return bool(cmpfr.mpfr_fits_ulong_p(&x._value, rnd)) + * + * def mpfr_fits_slong_p(Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return True if op would fit into a C long int. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_73mpfr_fits_slong_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_72mpfr_fits_slong_p, "mpfr_fits_slong_p(Mpfr_t x, mpfr_rnd_t rnd)\n\n Return True if op would fit into a C long int.\n\n Return True if op would fit into a C long int when rounded to an integer in\n the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_73mpfr_fits_slong_p = {"mpfr_fits_slong_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_73mpfr_fits_slong_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_72mpfr_fits_slong_p}; +static PyObject *__pyx_pw_4mpfr_73mpfr_fits_slong_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_fits_slong_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 955, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 955, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fits_slong_p", 1, 2, 2, 1); __PYX_ERR(1, 955, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_fits_slong_p") < 0)) __PYX_ERR(1, 955, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 955, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_fits_slong_p", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 955, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_fits_slong_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 955, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_72mpfr_fits_slong_p(__pyx_self, __pyx_v_x, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_72mpfr_fits_slong_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_fits_slong_p", 1); + + /* "mpfr.pyx":963 + * + * """ + * check_initialized(x) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return bool(cmpfr.mpfr_fits_slong_p(&x._value, rnd)) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 963, __pyx_L1_error) + + /* "mpfr.pyx":964 + * """ + * check_initialized(x) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_fits_slong_p(&x._value, rnd)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 964, __pyx_L1_error) + + /* "mpfr.pyx":965 + * check_initialized(x) + * check_rounding_mode(rnd) + * return bool(cmpfr.mpfr_fits_slong_p(&x._value, rnd)) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_fits_slong_p((&__pyx_v_x->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 965, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 965, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 965, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":955 + * return bool(cmpfr.mpfr_fits_ulong_p(&x._value, rnd)) + * + * def mpfr_fits_slong_p(Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return True if op would fit into a C long int. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_fits_slong_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":972 + * ############################################################################### + * + * def mpfr_add(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_75mpfr_add(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_74mpfr_add, "mpfr_add(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to op1 + op2 rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_75mpfr_add = {"mpfr_add", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_75mpfr_add, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_74mpfr_add}; +static PyObject *__pyx_pw_4mpfr_75mpfr_add(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_add (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 972, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 972, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_add", 1, 4, 4, 1); __PYX_ERR(1, 972, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 972, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_add", 1, 4, 4, 2); __PYX_ERR(1, 972, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 972, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_add", 1, 4, 4, 3); __PYX_ERR(1, 972, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_add") < 0)) __PYX_ERR(1, 972, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 973, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_add", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 972, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 972, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 972, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 972, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_74mpfr_add(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_74mpfr_add(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_add", 1); + + /* "mpfr.pyx":978 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 978, __pyx_L1_error) + + /* "mpfr.pyx":979 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 979, __pyx_L1_error) + + /* "mpfr.pyx":980 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_add(&rop._value, &op1._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 980, __pyx_L1_error) + + /* "mpfr.pyx":981 + * check_initialized(op1) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_add(&rop._value, &op1._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 981, __pyx_L1_error) + + /* "mpfr.pyx":982 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_add(&rop._value, &op1._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_sub(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_add((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":972 + * ############################################################################### + * + * def mpfr_add(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_add", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":984 + * return cmpfr.mpfr_add(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sub(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_77mpfr_sub(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_76mpfr_sub, "mpfr_sub(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to op1 - op2, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_77mpfr_sub = {"mpfr_sub", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_77mpfr_sub, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_76mpfr_sub}; +static PyObject *__pyx_pw_4mpfr_77mpfr_sub(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_sub (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 984, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 984, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sub", 1, 4, 4, 1); __PYX_ERR(1, 984, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 984, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sub", 1, 4, 4, 2); __PYX_ERR(1, 984, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 984, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sub", 1, 4, 4, 3); __PYX_ERR(1, 984, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_sub") < 0)) __PYX_ERR(1, 984, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 985, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_sub", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 984, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 984, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 984, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 984, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_76mpfr_sub(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_76mpfr_sub(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_sub", 1); + + /* "mpfr.pyx":990 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 990, __pyx_L1_error) + + /* "mpfr.pyx":991 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 991, __pyx_L1_error) + + /* "mpfr.pyx":992 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sub(&rop._value, &op1._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 992, __pyx_L1_error) + + /* "mpfr.pyx":993 + * check_initialized(op1) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_sub(&rop._value, &op1._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 993, __pyx_L1_error) + + /* "mpfr.pyx":994 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sub(&rop._value, &op1._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_mul(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_sub((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 994, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":984 + * return cmpfr.mpfr_add(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sub(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_sub", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":996 + * return cmpfr.mpfr_sub(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_mul(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_79mpfr_mul(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_78mpfr_mul, "mpfr_mul(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to op1 times op2, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_79mpfr_mul = {"mpfr_mul", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_79mpfr_mul, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_78mpfr_mul}; +static PyObject *__pyx_pw_4mpfr_79mpfr_mul(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_mul (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 996, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 996, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_mul", 1, 4, 4, 1); __PYX_ERR(1, 996, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 996, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_mul", 1, 4, 4, 2); __PYX_ERR(1, 996, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 996, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_mul", 1, 4, 4, 3); __PYX_ERR(1, 996, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_mul") < 0)) __PYX_ERR(1, 996, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 997, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_mul", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 996, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 996, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 996, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 996, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_78mpfr_mul(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_78mpfr_mul(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_mul", 1); + + /* "mpfr.pyx":1002 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1002, __pyx_L1_error) + + /* "mpfr.pyx":1003 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1003, __pyx_L1_error) + + /* "mpfr.pyx":1004 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_mul(&rop._value, &op1._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1004, __pyx_L1_error) + + /* "mpfr.pyx":1005 + * check_initialized(op1) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_mul(&rop._value, &op1._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1005, __pyx_L1_error) + + /* "mpfr.pyx":1006 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_mul(&rop._value, &op1._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_sqr(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_mul((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":996 + * return cmpfr.mpfr_sub(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_mul(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_mul", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1008 + * return cmpfr.mpfr_mul(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sqr(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the square of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_81mpfr_sqr(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_80mpfr_sqr, "mpfr_sqr(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the square of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_81mpfr_sqr = {"mpfr_sqr", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_81mpfr_sqr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_80mpfr_sqr}; +static PyObject *__pyx_pw_4mpfr_81mpfr_sqr(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_sqr (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1008, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1008, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sqr", 1, 3, 3, 1); __PYX_ERR(1, 1008, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1008, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sqr", 1, 3, 3, 2); __PYX_ERR(1, 1008, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_sqr") < 0)) __PYX_ERR(1, 1008, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1008, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_sqr", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1008, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_sqr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1008, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1008, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_80mpfr_sqr(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_80mpfr_sqr(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_sqr", 1); + + /* "mpfr.pyx":1013 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1013, __pyx_L1_error) + + /* "mpfr.pyx":1014 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sqr(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1014, __pyx_L1_error) + + /* "mpfr.pyx":1015 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_sqr(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1015, __pyx_L1_error) + + /* "mpfr.pyx":1016 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sqr(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_div(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_sqr((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1008 + * return cmpfr.mpfr_mul(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sqr(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the square of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_sqr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1018 + * return cmpfr.mpfr_sqr(&rop._value, &op._value, rnd) + * + * def mpfr_div(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_83mpfr_div(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_82mpfr_div, "mpfr_div(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to op1 divided by op2, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_83mpfr_div = {"mpfr_div", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_83mpfr_div, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_82mpfr_div}; +static PyObject *__pyx_pw_4mpfr_83mpfr_div(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_div (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1018, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1018, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_div", 1, 4, 4, 1); __PYX_ERR(1, 1018, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1018, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_div", 1, 4, 4, 2); __PYX_ERR(1, 1018, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1018, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_div", 1, 4, 4, 3); __PYX_ERR(1, 1018, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_div") < 0)) __PYX_ERR(1, 1018, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1019, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_div", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1018, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1018, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1018, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1018, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_82mpfr_div(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_82mpfr_div(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_div", 1); + + /* "mpfr.pyx":1024 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1024, __pyx_L1_error) + + /* "mpfr.pyx":1025 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1025, __pyx_L1_error) + + /* "mpfr.pyx":1026 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_div(&rop._value, &op1._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1026, __pyx_L1_error) + + /* "mpfr.pyx":1027 + * check_initialized(op1) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_div(&rop._value, &op1._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1027, __pyx_L1_error) + + /* "mpfr.pyx":1028 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_div(&rop._value, &op1._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_sqrt(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_div((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1018 + * return cmpfr.mpfr_sqr(&rop._value, &op._value, rnd) + * + * def mpfr_div(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_div", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1030 + * return cmpfr.mpfr_div(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sqrt(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the square root of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_85mpfr_sqrt(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_84mpfr_sqrt, "mpfr_sqrt(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the square root of op, rounded in the direction rnd.\n\n Set rop to \342\210\2220 if op is \342\210\2220, to be consistent with the IEEE 754 standard. Set\n rop to NaN if op is negative.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_85mpfr_sqrt = {"mpfr_sqrt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_85mpfr_sqrt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_84mpfr_sqrt}; +static PyObject *__pyx_pw_4mpfr_85mpfr_sqrt(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_sqrt (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1030, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1030, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sqrt", 1, 3, 3, 1); __PYX_ERR(1, 1030, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1030, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sqrt", 1, 3, 3, 2); __PYX_ERR(1, 1030, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_sqrt") < 0)) __PYX_ERR(1, 1030, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1030, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_sqrt", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1030, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1030, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1030, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_84mpfr_sqrt(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_84mpfr_sqrt(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_sqrt", 1); + + /* "mpfr.pyx":1038 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1038, __pyx_L1_error) + + /* "mpfr.pyx":1039 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sqrt(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1039, __pyx_L1_error) + + /* "mpfr.pyx":1040 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_sqrt(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1040, __pyx_L1_error) + + /* "mpfr.pyx":1041 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sqrt(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_rec_sqrt(Mpfr_t rop not None, Mpfr_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_sqrt((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1030 + * return cmpfr.mpfr_div(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sqrt(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the square root of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1043 + * return cmpfr.mpfr_sqrt(&rop._value, &op._value, rnd) + * + * def mpfr_rec_sqrt(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_87mpfr_rec_sqrt(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_86mpfr_rec_sqrt, "mpfr_rec_sqrt(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the reciprocal square root of op, rounded in the direction rnd.\n\n Set rop to +Inf if op is \302\2610, +0 if op is +Inf, and NaN if op is negative.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_87mpfr_rec_sqrt = {"mpfr_rec_sqrt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_87mpfr_rec_sqrt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_86mpfr_rec_sqrt}; +static PyObject *__pyx_pw_4mpfr_87mpfr_rec_sqrt(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_rec_sqrt (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1043, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1043, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rec_sqrt", 1, 3, 3, 1); __PYX_ERR(1, 1043, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1043, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rec_sqrt", 1, 3, 3, 2); __PYX_ERR(1, 1043, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_rec_sqrt") < 0)) __PYX_ERR(1, 1043, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_rec_sqrt", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1043, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_rec_sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1043, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1043, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_86mpfr_rec_sqrt(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_86mpfr_rec_sqrt(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_rec_sqrt", 1); + + /* "mpfr.pyx":1051 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1051, __pyx_L1_error) + + /* "mpfr.pyx":1052 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rec_sqrt(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1052, __pyx_L1_error) + + /* "mpfr.pyx":1053 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_rec_sqrt(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1053, __pyx_L1_error) + + /* "mpfr.pyx":1054 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rec_sqrt(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_cbrt(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_rec_sqrt((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1054, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1043 + * return cmpfr.mpfr_sqrt(&rop._value, &op._value, rnd) + * + * def mpfr_rec_sqrt(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_rec_sqrt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1056 + * return cmpfr.mpfr_rec_sqrt(&rop._value, &op._value, rnd) + * + * def mpfr_cbrt(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cube root of op rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_89mpfr_cbrt(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_88mpfr_cbrt, "mpfr_cbrt(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the cube root of op rounded in the direction rnd.\n\n For op negative, set rop to a negative number. The cube root of -0 is\n defined to be -0.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_89mpfr_cbrt = {"mpfr_cbrt", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_89mpfr_cbrt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_88mpfr_cbrt}; +static PyObject *__pyx_pw_4mpfr_89mpfr_cbrt(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_cbrt (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1056, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1056, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_cbrt", 1, 3, 3, 1); __PYX_ERR(1, 1056, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1056, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_cbrt", 1, 3, 3, 2); __PYX_ERR(1, 1056, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_cbrt") < 0)) __PYX_ERR(1, 1056, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1056, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_cbrt", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1056, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_cbrt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1056, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1056, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_88mpfr_cbrt(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_88mpfr_cbrt(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_cbrt", 1); + + /* "mpfr.pyx":1064 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1064, __pyx_L1_error) + + /* "mpfr.pyx":1065 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_cbrt(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1065, __pyx_L1_error) + + /* "mpfr.pyx":1066 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_cbrt(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1066, __pyx_L1_error) + + /* "mpfr.pyx":1067 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_cbrt(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_rootn_ui(Mpfr_t rop not None, Mpfr_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_cbrt((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1056 + * return cmpfr.mpfr_rec_sqrt(&rop._value, &op._value, rnd) + * + * def mpfr_cbrt(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cube root of op rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_cbrt", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1069 + * return cmpfr.mpfr_cbrt(&rop._value, &op._value, rnd) + * + * def mpfr_rootn_ui(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_91mpfr_rootn_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_90mpfr_rootn_ui, "mpfr_rootn_ui(Mpfr_t rop, Mpfr_t op, unsigned long k, mpfr_rnd_t rnd)\n\n Set rop to the kth root of op rounded in the direction rnd.\n\n For k = 0, set rop to NaN. For k odd (resp. even) and op negative\n (including -Inf), set rop to a negative number (resp. NaN). If op is zero,\n set rop to zero with the sign obtained by the usual limit rules, i.e., the\n same sign as op if k is odd, and positive if k is even.\n\n This function agrees with the rootn function of the IEEE 754-2008\n standard.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_91mpfr_rootn_ui = {"mpfr_rootn_ui", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_91mpfr_rootn_ui, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_90mpfr_rootn_ui}; +static PyObject *__pyx_pw_4mpfr_91mpfr_rootn_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + unsigned long __pyx_v_k; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_rootn_ui (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_k,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1069, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1069, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rootn_ui", 1, 4, 4, 1); __PYX_ERR(1, 1069, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1069, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rootn_ui", 1, 4, 4, 2); __PYX_ERR(1, 1069, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1069, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rootn_ui", 1, 4, 4, 3); __PYX_ERR(1, 1069, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_rootn_ui") < 0)) __PYX_ERR(1, 1069, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_k = __Pyx_PyInt_As_unsigned_long(values[2]); if (unlikely((__pyx_v_k == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1070, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1070, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_rootn_ui", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1069, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_rootn_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1069, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1069, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_90mpfr_rootn_ui(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_k, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_90mpfr_rootn_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, unsigned long __pyx_v_k, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_rootn_ui", 1); + + /* "mpfr.pyx":1083 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1083, __pyx_L1_error) + + /* "mpfr.pyx":1084 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rootn_ui(&rop._value, &op._value, k, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1084, __pyx_L1_error) + + /* "mpfr.pyx":1085 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_rootn_ui(&rop._value, &op._value, k, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1085, __pyx_L1_error) + + /* "mpfr.pyx":1086 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rootn_ui(&rop._value, &op._value, k, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_root(Mpfr_t rop not None, Mpfr_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_rootn_ui((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_k, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1069 + * return cmpfr.mpfr_cbrt(&rop._value, &op._value, rnd) + * + * def mpfr_rootn_ui(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_rootn_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1088 + * return cmpfr.mpfr_rootn_ui(&rop._value, &op._value, k, rnd) + * + * def mpfr_root(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_93mpfr_root(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_92mpfr_root, "mpfr_root(Mpfr_t rop, Mpfr_t op, unsigned long k, mpfr_rnd_t rnd)\n\n Set rop to the kth root of op, rounding in the direction rnd.\n\n This function is the same as mpfr_rootn_ui except when op is -0 and k is\n even: the result is -0 instead of +0 (the reason was to be consistent with\n mpfr_sqrt). Said otherwise, if op is zero, set rop to op.\n\n This function predates the IEEE 754-2008 standard and behaves differently\n from its rootn function. It is marked as deprecated and will be removed\n in a future release.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_93mpfr_root = {"mpfr_root", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_93mpfr_root, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_92mpfr_root}; +static PyObject *__pyx_pw_4mpfr_93mpfr_root(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + unsigned long __pyx_v_k; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_root (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_k,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1088, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1088, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_root", 1, 4, 4, 1); __PYX_ERR(1, 1088, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1088, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_root", 1, 4, 4, 2); __PYX_ERR(1, 1088, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1088, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_root", 1, 4, 4, 3); __PYX_ERR(1, 1088, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_root") < 0)) __PYX_ERR(1, 1088, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_k = __Pyx_PyInt_As_unsigned_long(values[2]); if (unlikely((__pyx_v_k == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1089, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1089, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_root", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1088, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_root", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1088, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1088, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_92mpfr_root(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_k, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_92mpfr_root(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, unsigned long __pyx_v_k, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_root", 1); + + /* "mpfr.pyx":1102 + * + * """ + * warnings.warn( # <<<<<<<<<<<<<< + * "mpfr_root is deprecated. Use mpfr_rootn_ui instead.", + * category=DeprecationWarning, + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "mpfr.pyx":1104 + * warnings.warn( + * "mpfr_root is deprecated. Use mpfr_rootn_ui instead.", + * category=DeprecationWarning, # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_category, __pyx_builtin_DeprecationWarning) < 0) __PYX_ERR(1, 1104, __pyx_L1_error) + + /* "mpfr.pyx":1102 + * + * """ + * warnings.warn( # <<<<<<<<<<<<<< + * "mpfr_root is deprecated. Use mpfr_rootn_ui instead.", + * category=DeprecationWarning, + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "mpfr.pyx":1107 + * ) + * + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_4 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1107, __pyx_L1_error) + + /* "mpfr.pyx":1108 + * + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + */ + __pyx_t_4 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1108, __pyx_L1_error) + + /* "mpfr.pyx":1109 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + * + */ + __pyx_t_4 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1109, __pyx_L1_error) + + /* "mpfr.pyx":1110 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) # <<<<<<<<<<<<<< + * + * def _mpfr_root_no_warn(Mpfr_t rop not None, Mpfr_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyInt_From_int(mpfr_root((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_k, __pyx_v_rnd)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1088 + * return cmpfr.mpfr_rootn_ui(&rop._value, &op._value, k, rnd) + * + * def mpfr_root(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("mpfr.mpfr_root", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1112 + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + * + * def _mpfr_root_no_warn(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_95_mpfr_root_no_warn(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_94_mpfr_root_no_warn, "_mpfr_root_no_warn(Mpfr_t rop, Mpfr_t op, unsigned long k, mpfr_rnd_t rnd)\nSet rop to the kth root of op, rounding in the direction rnd.\n\n This is a private variant of mpfr_root that doesn't warn, for use\n by the higher-level root function (which already warns).\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_95_mpfr_root_no_warn = {"_mpfr_root_no_warn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_95_mpfr_root_no_warn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_94_mpfr_root_no_warn}; +static PyObject *__pyx_pw_4mpfr_95_mpfr_root_no_warn(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + unsigned long __pyx_v_k; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_mpfr_root_no_warn (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_k,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1112, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1112, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_mpfr_root_no_warn", 1, 4, 4, 1); __PYX_ERR(1, 1112, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1112, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_mpfr_root_no_warn", 1, 4, 4, 2); __PYX_ERR(1, 1112, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1112, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_mpfr_root_no_warn", 1, 4, 4, 3); __PYX_ERR(1, 1112, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_mpfr_root_no_warn") < 0)) __PYX_ERR(1, 1112, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_k = __Pyx_PyInt_As_unsigned_long(values[2]); if (unlikely((__pyx_v_k == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1113, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1113, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_mpfr_root_no_warn", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1112, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr._mpfr_root_no_warn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1112, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1112, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_94_mpfr_root_no_warn(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_k, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_94_mpfr_root_no_warn(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, unsigned long __pyx_v_k, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_mpfr_root_no_warn", 1); + + /* "mpfr.pyx":1121 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1121, __pyx_L1_error) + + /* "mpfr.pyx":1122 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1122, __pyx_L1_error) + + /* "mpfr.pyx":1123 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1123, __pyx_L1_error) + + /* "mpfr.pyx":1124 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_pow(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_root((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_k, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1112 + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + * + * def _mpfr_root_no_warn(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr._mpfr_root_no_warn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1126 + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + * + * def mpfr_pow(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_97mpfr_pow(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_96mpfr_pow, "mpfr_pow(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to op1 raised to the power op2, rounded in the direction rnd.\n\n Special values are handled as described in the ISO C99 and IEEE 754-2008\n standards for the pow function.\n\n * pow(\302\2610, y) returns plus or minus infinity for y a negative odd integer.\n\n * pow(\302\2610, y) returns plus infinity for y negative and not an odd integer.\n\n * pow(\302\2610, y) returns plus or minus zero for y a positive odd integer.\n\n * pow(\302\2610, y) returns plus zero for y positive and not an odd integer.\n\n * pow(-1, \302\261Inf) returns 1.\n\n * pow(+1, y) returns 1 for any y, even a NaN.\n\n * pow(x, \302\2610) returns 1 for any x, even a NaN.\n\n * pow(x, y) returns NaN for finite negative x and finite non-integer y.\n\n * pow(x, -Inf) returns plus infinity for 0 < abs(x) < 1, and plus zero\n for abs(x) > 1.\n\n * pow(x, +Inf) returns plus zero for 0 < abs(x) < 1, and plus infinity\n for abs(x) > 1.\n\n * pow(-Inf, y) returns minus zero for y a negative odd integer.\n\n * pow(-Inf, y) returns plus zero for y negative and not an odd integer.\n\n * pow(-Inf, y) returns minus infinity for y a positive odd integer.\n\n * pow(-Inf, y) returns plus infinity for y positive and not an odd\n integer.\n\n * pow(+Inf, y) returns plus zero for y negative, and plus infinity for y\n positive.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_97mpfr_pow = {"mpfr_pow", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_97mpfr_pow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_96mpfr_pow}; +static PyObject *__pyx_pw_4mpfr_97mpfr_pow(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_pow (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1126, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1126, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_pow", 1, 4, 4, 1); __PYX_ERR(1, 1126, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1126, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_pow", 1, 4, 4, 2); __PYX_ERR(1, 1126, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1126, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_pow", 1, 4, 4, 3); __PYX_ERR(1, 1126, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_pow") < 0)) __PYX_ERR(1, 1126, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1127, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_pow", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1126, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_pow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1126, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1126, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1126, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_96mpfr_pow(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_96mpfr_pow(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_pow", 1); + + /* "mpfr.pyx":1169 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1169, __pyx_L1_error) + + /* "mpfr.pyx":1170 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1170, __pyx_L1_error) + + /* "mpfr.pyx":1171 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_pow(&rop._value, &op1._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1171, __pyx_L1_error) + + /* "mpfr.pyx":1172 + * check_initialized(op1) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_pow(&rop._value, &op1._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1172, __pyx_L1_error) + + /* "mpfr.pyx":1173 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_pow(&rop._value, &op1._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_neg(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_pow((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1126 + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + * + * def mpfr_pow(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_pow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1175 + * return cmpfr.mpfr_pow(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_neg(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to -op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_99mpfr_neg(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_98mpfr_neg, "mpfr_neg(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to -op, rounded in the direction rnd.\n\n This function just changes or adjusts the sign if rop and op are the same\n variable, otherwise a rounding might occur if the precision of rop is less\n than that of op.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_99mpfr_neg = {"mpfr_neg", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_99mpfr_neg, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_98mpfr_neg}; +static PyObject *__pyx_pw_4mpfr_99mpfr_neg(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_neg (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1175, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1175, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_neg", 1, 3, 3, 1); __PYX_ERR(1, 1175, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1175, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_neg", 1, 3, 3, 2); __PYX_ERR(1, 1175, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_neg") < 0)) __PYX_ERR(1, 1175, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1175, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_neg", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1175, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_neg", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1175, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1175, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_98mpfr_neg(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_98mpfr_neg(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_neg", 1); + + /* "mpfr.pyx":1184 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1184, __pyx_L1_error) + + /* "mpfr.pyx":1185 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_neg(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1185, __pyx_L1_error) + + /* "mpfr.pyx":1186 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_neg(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1186, __pyx_L1_error) + + /* "mpfr.pyx":1187 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_neg(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_abs(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_neg((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1175 + * return cmpfr.mpfr_pow(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_neg(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to -op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_neg", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1189 + * return cmpfr.mpfr_neg(&rop._value, &op._value, rnd) + * + * def mpfr_abs(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the absolute value of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_101mpfr_abs(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_100mpfr_abs, "mpfr_abs(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the absolute value of op, rounded in the direction rnd.\n\n This function just changes or adjusts the sign if rop and op are the same\n variable, otherwise a rounding might occur if the precision of rop is less\n than that of op.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_101mpfr_abs = {"mpfr_abs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_101mpfr_abs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_100mpfr_abs}; +static PyObject *__pyx_pw_4mpfr_101mpfr_abs(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_abs (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1189, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1189, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_abs", 1, 3, 3, 1); __PYX_ERR(1, 1189, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1189, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_abs", 1, 3, 3, 2); __PYX_ERR(1, 1189, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_abs") < 0)) __PYX_ERR(1, 1189, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1189, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_abs", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1189, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_abs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1189, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1189, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_100mpfr_abs(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_100mpfr_abs(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_abs", 1); + + /* "mpfr.pyx":1198 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1198, __pyx_L1_error) + + /* "mpfr.pyx":1199 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_abs(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1199, __pyx_L1_error) + + /* "mpfr.pyx":1200 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_abs(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1200, __pyx_L1_error) + + /* "mpfr.pyx":1201 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_abs(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_dim(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_abs((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1201, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1189 + * return cmpfr.mpfr_neg(&rop._value, &op._value, rnd) + * + * def mpfr_abs(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the absolute value of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_abs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1203 + * return cmpfr.mpfr_abs(&rop._value, &op._value, rnd) + * + * def mpfr_dim(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_103mpfr_dim(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_102mpfr_dim, "mpfr_dim(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to max(op1 - op2, 0), rounded in the direction rnd.\n\n Set rop to op1 - op2 rounded in the direction rnd if op1 > op2, +0 if op1\n <= op2, and NaN if op1 or op2 is NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_103mpfr_dim = {"mpfr_dim", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_103mpfr_dim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_102mpfr_dim}; +static PyObject *__pyx_pw_4mpfr_103mpfr_dim(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_dim (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1203, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1203, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_dim", 1, 4, 4, 1); __PYX_ERR(1, 1203, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1203, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_dim", 1, 4, 4, 2); __PYX_ERR(1, 1203, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1203, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_dim", 1, 4, 4, 3); __PYX_ERR(1, 1203, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_dim") < 0)) __PYX_ERR(1, 1203, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1204, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_dim", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1203, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1203, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1203, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1203, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_102mpfr_dim(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_102mpfr_dim(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_dim", 1); + + /* "mpfr.pyx":1212 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1212, __pyx_L1_error) + + /* "mpfr.pyx":1213 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1213, __pyx_L1_error) + + /* "mpfr.pyx":1214 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_dim(&rop._value, &op1._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1214, __pyx_L1_error) + + /* "mpfr.pyx":1215 + * check_initialized(op1) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_dim(&rop._value, &op1._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1215, __pyx_L1_error) + + /* "mpfr.pyx":1216 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_dim(&rop._value, &op1._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_dim((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1203 + * return cmpfr.mpfr_abs(&rop._value, &op._value, rnd) + * + * def mpfr_dim(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_dim", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1223 + * ############################################################################### + * + * def mpfr_cmp(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Perform a three-way comparison of op1 and op2. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_105mpfr_cmp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_104mpfr_cmp, "mpfr_cmp(Mpfr_t op1, Mpfr_t op2)\n\n Perform a three-way comparison of op1 and op2.\n\n Return a positive value if op1 > op2, zero if op1 = op2, and a negative\n value if op1 < op2. Both op1 and op2 are considered to their full own\n precision, which may differ. If one of the operands is NaN, set the erange\n flag and return zero.\n\n Note: This function may be useful to distinguish the three possible\n cases. If you need to distinguish two cases only, it is recommended to use\n the predicate functions (e.g., mpfr_equal_p for the equality) described\n below; they behave like the IEEE 754 comparisons, in particular when one or\n both arguments are NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_105mpfr_cmp = {"mpfr_cmp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_105mpfr_cmp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_104mpfr_cmp}; +static PyObject *__pyx_pw_4mpfr_105mpfr_cmp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_cmp (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op1,&__pyx_n_s_op2,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1223, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1223, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_cmp", 1, 2, 2, 1); __PYX_ERR(1, 1223, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_cmp") < 0)) __PYX_ERR(1, 1223, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_cmp", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 1223, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_cmp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1223, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1223, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_104mpfr_cmp(__pyx_self, __pyx_v_op1, __pyx_v_op2); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_104mpfr_cmp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_cmp", 1); + + /* "mpfr.pyx":1239 + * + * """ + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * return cmpfr.mpfr_cmp(&op1._value, &op2._value) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1239, __pyx_L1_error) + + /* "mpfr.pyx":1240 + * """ + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_cmp(&op1._value, &op2._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1240, __pyx_L1_error) + + /* "mpfr.pyx":1241 + * check_initialized(op1) + * check_initialized(op2) + * return cmpfr.mpfr_cmp(&op1._value, &op2._value) # <<<<<<<<<<<<<< + * + * def mpfr_cmpabs(Mpfr_t op1 not None, Mpfr_t op2 not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_cmp((&__pyx_v_op1->_value), (&__pyx_v_op2->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1223 + * ############################################################################### + * + * def mpfr_cmp(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Perform a three-way comparison of op1 and op2. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_cmp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1243 + * return cmpfr.mpfr_cmp(&op1._value, &op2._value) + * + * def mpfr_cmpabs(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Compare the absolute values of op1 and op2. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_107mpfr_cmpabs(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_106mpfr_cmpabs, "mpfr_cmpabs(Mpfr_t op1, Mpfr_t op2)\n\n Compare the absolute values of op1 and op2.\n\n Compare |op1| and |op2|. Return a positive value if |op1| > |op2|, zero if\n |op1| == |op2|, and a negative value if |op1| < |op2|. If one of the\n operands is NaN, set the erange flag and return zero.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_107mpfr_cmpabs = {"mpfr_cmpabs", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_107mpfr_cmpabs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_106mpfr_cmpabs}; +static PyObject *__pyx_pw_4mpfr_107mpfr_cmpabs(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_cmpabs (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op1,&__pyx_n_s_op2,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1243, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1243, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_cmpabs", 1, 2, 2, 1); __PYX_ERR(1, 1243, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_cmpabs") < 0)) __PYX_ERR(1, 1243, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_cmpabs", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 1243, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_cmpabs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1243, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1243, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_106mpfr_cmpabs(__pyx_self, __pyx_v_op1, __pyx_v_op2); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_106mpfr_cmpabs(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_cmpabs", 1); + + /* "mpfr.pyx":1252 + * + * """ + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * return cmpfr.mpfr_cmpabs(&op1._value, &op2._value) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1252, __pyx_L1_error) + + /* "mpfr.pyx":1253 + * """ + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_cmpabs(&op1._value, &op2._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1253, __pyx_L1_error) + + /* "mpfr.pyx":1254 + * check_initialized(op1) + * check_initialized(op2) + * return cmpfr.mpfr_cmpabs(&op1._value, &op2._value) # <<<<<<<<<<<<<< + * + * def mpfr_nan_p(Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_cmpabs((&__pyx_v_op1->_value), (&__pyx_v_op2->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1243 + * return cmpfr.mpfr_cmp(&op1._value, &op2._value) + * + * def mpfr_cmpabs(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Compare the absolute values of op1 and op2. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_cmpabs", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1256 + * return cmpfr.mpfr_cmpabs(&op1._value, &op2._value) + * + * def mpfr_nan_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is a NaN. Return False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_109mpfr_nan_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_108mpfr_nan_p, "mpfr_nan_p(Mpfr_t op)\n\n Return True if op is a NaN. Return False otherwise.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_109mpfr_nan_p = {"mpfr_nan_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_109mpfr_nan_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_108mpfr_nan_p}; +static PyObject *__pyx_pw_4mpfr_109mpfr_nan_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_nan_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1256, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_nan_p") < 0)) __PYX_ERR(1, 1256, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_nan_p", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 1256, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_nan_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1256, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_108mpfr_nan_p(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_108mpfr_nan_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_nan_p", 1); + + /* "mpfr.pyx":1261 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_nan_p(&op._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1261, __pyx_L1_error) + + /* "mpfr.pyx":1262 + * """ + * check_initialized(op) + * return bool(cmpfr.mpfr_nan_p(&op._value)) # <<<<<<<<<<<<<< + * + * def mpfr_inf_p(Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_nan_p((&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1262, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1262, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1256 + * return cmpfr.mpfr_cmpabs(&op1._value, &op2._value) + * + * def mpfr_nan_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is a NaN. Return False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_nan_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1264 + * return bool(cmpfr.mpfr_nan_p(&op._value)) + * + * def mpfr_inf_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an infinity. Return False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_111mpfr_inf_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_110mpfr_inf_p, "mpfr_inf_p(Mpfr_t op)\n\n Return True if op is an infinity. Return False otherwise.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_111mpfr_inf_p = {"mpfr_inf_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_111mpfr_inf_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_110mpfr_inf_p}; +static PyObject *__pyx_pw_4mpfr_111mpfr_inf_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_inf_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1264, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_inf_p") < 0)) __PYX_ERR(1, 1264, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_inf_p", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 1264, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_inf_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1264, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_110mpfr_inf_p(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_110mpfr_inf_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_inf_p", 1); + + /* "mpfr.pyx":1269 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_inf_p(&op._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1269, __pyx_L1_error) + + /* "mpfr.pyx":1270 + * """ + * check_initialized(op) + * return bool(cmpfr.mpfr_inf_p(&op._value)) # <<<<<<<<<<<<<< + * + * def mpfr_number_p(Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_inf_p((&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1270, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1264 + * return bool(cmpfr.mpfr_nan_p(&op._value)) + * + * def mpfr_inf_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an infinity. Return False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_inf_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1272 + * return bool(cmpfr.mpfr_inf_p(&op._value)) + * + * def mpfr_number_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an ordinary number. Return False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_113mpfr_number_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_112mpfr_number_p, "mpfr_number_p(Mpfr_t op)\n\n Return True if op is an ordinary number. Return False otherwise.\n\n An ordinary number is a number which is neither a NaN nor an infinity.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_113mpfr_number_p = {"mpfr_number_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_113mpfr_number_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_112mpfr_number_p}; +static PyObject *__pyx_pw_4mpfr_113mpfr_number_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_number_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1272, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_number_p") < 0)) __PYX_ERR(1, 1272, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_number_p", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 1272, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_number_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1272, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_112mpfr_number_p(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_112mpfr_number_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_number_p", 1); + + /* "mpfr.pyx":1279 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_number_p(&op._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1279, __pyx_L1_error) + + /* "mpfr.pyx":1280 + * """ + * check_initialized(op) + * return bool(cmpfr.mpfr_number_p(&op._value)) # <<<<<<<<<<<<<< + * + * def mpfr_zero_p(Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_number_p((&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1280, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1280, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1272 + * return bool(cmpfr.mpfr_inf_p(&op._value)) + * + * def mpfr_number_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an ordinary number. Return False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_number_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1282 + * return bool(cmpfr.mpfr_number_p(&op._value)) + * + * def mpfr_zero_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is zero. Return False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_115mpfr_zero_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_114mpfr_zero_p, "mpfr_zero_p(Mpfr_t op)\n\n Return True if op is zero. Return False otherwise.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_115mpfr_zero_p = {"mpfr_zero_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_115mpfr_zero_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_114mpfr_zero_p}; +static PyObject *__pyx_pw_4mpfr_115mpfr_zero_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_zero_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1282, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_zero_p") < 0)) __PYX_ERR(1, 1282, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_zero_p", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 1282, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_zero_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1282, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_114mpfr_zero_p(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_114mpfr_zero_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_zero_p", 1); + + /* "mpfr.pyx":1287 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_zero_p(&op._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1287, __pyx_L1_error) + + /* "mpfr.pyx":1288 + * """ + * check_initialized(op) + * return bool(cmpfr.mpfr_zero_p(&op._value)) # <<<<<<<<<<<<<< + * + * def mpfr_regular_p(Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_zero_p((&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1288, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1282 + * return bool(cmpfr.mpfr_number_p(&op._value)) + * + * def mpfr_zero_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is zero. Return False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_zero_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1290 + * return bool(cmpfr.mpfr_zero_p(&op._value)) + * + * def mpfr_regular_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is a regular number. Return False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_117mpfr_regular_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_116mpfr_regular_p, "mpfr_regular_p(Mpfr_t op)\n\n Return True if op is a regular number. Return False otherwise.\n\n A regular number is a number which is neither a NaN, nor an infinity, nor a\n zero.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_117mpfr_regular_p = {"mpfr_regular_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_117mpfr_regular_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_116mpfr_regular_p}; +static PyObject *__pyx_pw_4mpfr_117mpfr_regular_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_regular_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1290, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_regular_p") < 0)) __PYX_ERR(1, 1290, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_regular_p", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 1290, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_regular_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1290, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_116mpfr_regular_p(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_116mpfr_regular_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_regular_p", 1); + + /* "mpfr.pyx":1298 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_regular_p(&op._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1298, __pyx_L1_error) + + /* "mpfr.pyx":1299 + * """ + * check_initialized(op) + * return bool(cmpfr.mpfr_regular_p(&op._value)) # <<<<<<<<<<<<<< + * + * def mpfr_sgn(Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_regular_p((&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1299, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1290 + * return bool(cmpfr.mpfr_zero_p(&op._value)) + * + * def mpfr_regular_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is a regular number. Return False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_regular_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1301 + * return bool(cmpfr.mpfr_regular_p(&op._value)) + * + * def mpfr_sgn(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return the sign of op. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_119mpfr_sgn(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_118mpfr_sgn, "mpfr_sgn(Mpfr_t op)\n\n Return the sign of op.\n\n Return a positive value if op > 0, zero if op = 0, and a negative value if\n op < 0. If the operand is NaN, set the erange flag and return zero. This is\n equivalent to mpfr_cmp_ui (op, 0), but more efficient.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_119mpfr_sgn = {"mpfr_sgn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_119mpfr_sgn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_118mpfr_sgn}; +static PyObject *__pyx_pw_4mpfr_119mpfr_sgn(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_sgn (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1301, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_sgn") < 0)) __PYX_ERR(1, 1301, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_sgn", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 1301, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_sgn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1301, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_118mpfr_sgn(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_118mpfr_sgn(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_sgn", 1); + + /* "mpfr.pyx":1310 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_sgn(&op._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1310, __pyx_L1_error) + + /* "mpfr.pyx":1311 + * """ + * check_initialized(op) + * return cmpfr.mpfr_sgn(&op._value) # <<<<<<<<<<<<<< + * + * def mpfr_greater_p(Mpfr_t op1 not None, Mpfr_t op2 not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_sgn((&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1311, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1301 + * return bool(cmpfr.mpfr_regular_p(&op._value)) + * + * def mpfr_sgn(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return the sign of op. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_sgn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1313 + * return cmpfr.mpfr_sgn(&op._value) + * + * def mpfr_greater_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 > op2 and False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_121mpfr_greater_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_120mpfr_greater_p, "mpfr_greater_p(Mpfr_t op1, Mpfr_t op2)\n\n Return True if op1 > op2 and False otherwise.\n\n This function returns False whenever op1 and/or op2 is a NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_121mpfr_greater_p = {"mpfr_greater_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_121mpfr_greater_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_120mpfr_greater_p}; +static PyObject *__pyx_pw_4mpfr_121mpfr_greater_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_greater_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op1,&__pyx_n_s_op2,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1313, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1313, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_greater_p", 1, 2, 2, 1); __PYX_ERR(1, 1313, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_greater_p") < 0)) __PYX_ERR(1, 1313, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_greater_p", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 1313, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_greater_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1313, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1313, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_120mpfr_greater_p(__pyx_self, __pyx_v_op1, __pyx_v_op2); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_120mpfr_greater_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_greater_p", 1); + + /* "mpfr.pyx":1320 + * + * """ + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * return bool(cmpfr.mpfr_greater_p(&op1._value, &op2._value)) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1320, __pyx_L1_error) + + /* "mpfr.pyx":1321 + * """ + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_greater_p(&op1._value, &op2._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1321, __pyx_L1_error) + + /* "mpfr.pyx":1322 + * check_initialized(op1) + * check_initialized(op2) + * return bool(cmpfr.mpfr_greater_p(&op1._value, &op2._value)) # <<<<<<<<<<<<<< + * + * def mpfr_greaterequal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_greater_p((&__pyx_v_op1->_value), (&__pyx_v_op2->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1322, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1322, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1313 + * return cmpfr.mpfr_sgn(&op._value) + * + * def mpfr_greater_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 > op2 and False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_greater_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1324 + * return bool(cmpfr.mpfr_greater_p(&op1._value, &op2._value)) + * + * def mpfr_greaterequal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 >= op2 and False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_123mpfr_greaterequal_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_122mpfr_greaterequal_p, "mpfr_greaterequal_p(Mpfr_t op1, Mpfr_t op2)\n\n Return True if op1 >= op2 and False otherwise.\n\n This function returns False whenever op1 and/or op2 is a NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_123mpfr_greaterequal_p = {"mpfr_greaterequal_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_123mpfr_greaterequal_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_122mpfr_greaterequal_p}; +static PyObject *__pyx_pw_4mpfr_123mpfr_greaterequal_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_greaterequal_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op1,&__pyx_n_s_op2,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1324, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1324, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_greaterequal_p", 1, 2, 2, 1); __PYX_ERR(1, 1324, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_greaterequal_p") < 0)) __PYX_ERR(1, 1324, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_greaterequal_p", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 1324, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_greaterequal_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1324, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1324, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_122mpfr_greaterequal_p(__pyx_self, __pyx_v_op1, __pyx_v_op2); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_122mpfr_greaterequal_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_greaterequal_p", 1); + + /* "mpfr.pyx":1331 + * + * """ + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * return bool(cmpfr.mpfr_greaterequal_p(&op1._value, &op2._value)) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1331, __pyx_L1_error) + + /* "mpfr.pyx":1332 + * """ + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_greaterequal_p(&op1._value, &op2._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1332, __pyx_L1_error) + + /* "mpfr.pyx":1333 + * check_initialized(op1) + * check_initialized(op2) + * return bool(cmpfr.mpfr_greaterequal_p(&op1._value, &op2._value)) # <<<<<<<<<<<<<< + * + * def mpfr_less_p(Mpfr_t op1 not None, Mpfr_t op2 not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_greaterequal_p((&__pyx_v_op1->_value), (&__pyx_v_op2->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1333, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1324 + * return bool(cmpfr.mpfr_greater_p(&op1._value, &op2._value)) + * + * def mpfr_greaterequal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 >= op2 and False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_greaterequal_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1335 + * return bool(cmpfr.mpfr_greaterequal_p(&op1._value, &op2._value)) + * + * def mpfr_less_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 < op2 and False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_125mpfr_less_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_124mpfr_less_p, "mpfr_less_p(Mpfr_t op1, Mpfr_t op2)\n\n Return True if op1 < op2 and False otherwise.\n\n This function returns False whenever op1 and/or op2 is a NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_125mpfr_less_p = {"mpfr_less_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_125mpfr_less_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_124mpfr_less_p}; +static PyObject *__pyx_pw_4mpfr_125mpfr_less_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_less_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op1,&__pyx_n_s_op2,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1335, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1335, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_less_p", 1, 2, 2, 1); __PYX_ERR(1, 1335, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_less_p") < 0)) __PYX_ERR(1, 1335, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_less_p", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 1335, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_less_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1335, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1335, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_124mpfr_less_p(__pyx_self, __pyx_v_op1, __pyx_v_op2); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_124mpfr_less_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_less_p", 1); + + /* "mpfr.pyx":1342 + * + * """ + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * return bool(cmpfr.mpfr_less_p(&op1._value, &op2._value)) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1342, __pyx_L1_error) + + /* "mpfr.pyx":1343 + * """ + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_less_p(&op1._value, &op2._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1343, __pyx_L1_error) + + /* "mpfr.pyx":1344 + * check_initialized(op1) + * check_initialized(op2) + * return bool(cmpfr.mpfr_less_p(&op1._value, &op2._value)) # <<<<<<<<<<<<<< + * + * def mpfr_lessequal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_less_p((&__pyx_v_op1->_value), (&__pyx_v_op2->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1344, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1344, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1335 + * return bool(cmpfr.mpfr_greaterequal_p(&op1._value, &op2._value)) + * + * def mpfr_less_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 < op2 and False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_less_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1346 + * return bool(cmpfr.mpfr_less_p(&op1._value, &op2._value)) + * + * def mpfr_lessequal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 <= op2 and False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_127mpfr_lessequal_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_126mpfr_lessequal_p, "mpfr_lessequal_p(Mpfr_t op1, Mpfr_t op2)\n\n Return True if op1 <= op2 and False otherwise.\n\n This function returns False whenever op1 and/or op2 is a NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_127mpfr_lessequal_p = {"mpfr_lessequal_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_127mpfr_lessequal_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_126mpfr_lessequal_p}; +static PyObject *__pyx_pw_4mpfr_127mpfr_lessequal_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_lessequal_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op1,&__pyx_n_s_op2,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1346, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1346, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_lessequal_p", 1, 2, 2, 1); __PYX_ERR(1, 1346, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_lessequal_p") < 0)) __PYX_ERR(1, 1346, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_lessequal_p", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 1346, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_lessequal_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1346, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1346, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_126mpfr_lessequal_p(__pyx_self, __pyx_v_op1, __pyx_v_op2); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_126mpfr_lessequal_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_lessequal_p", 1); + + /* "mpfr.pyx":1353 + * + * """ + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * return bool(cmpfr.mpfr_lessequal_p(&op1._value, &op2._value)) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1353, __pyx_L1_error) + + /* "mpfr.pyx":1354 + * """ + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_lessequal_p(&op1._value, &op2._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1354, __pyx_L1_error) + + /* "mpfr.pyx":1355 + * check_initialized(op1) + * check_initialized(op2) + * return bool(cmpfr.mpfr_lessequal_p(&op1._value, &op2._value)) # <<<<<<<<<<<<<< + * + * def mpfr_equal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_lessequal_p((&__pyx_v_op1->_value), (&__pyx_v_op2->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1355, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1346 + * return bool(cmpfr.mpfr_less_p(&op1._value, &op2._value)) + * + * def mpfr_lessequal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 <= op2 and False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_lessequal_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1357 + * return bool(cmpfr.mpfr_lessequal_p(&op1._value, &op2._value)) + * + * def mpfr_equal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 == op2 and False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_129mpfr_equal_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_128mpfr_equal_p, "mpfr_equal_p(Mpfr_t op1, Mpfr_t op2)\n\n Return True if op1 == op2 and False otherwise.\n\n This function returns False whenever op1 and/or op2 is a NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_129mpfr_equal_p = {"mpfr_equal_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_129mpfr_equal_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_128mpfr_equal_p}; +static PyObject *__pyx_pw_4mpfr_129mpfr_equal_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_equal_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op1,&__pyx_n_s_op2,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1357, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1357, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_equal_p", 1, 2, 2, 1); __PYX_ERR(1, 1357, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_equal_p") < 0)) __PYX_ERR(1, 1357, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_equal_p", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 1357, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_equal_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1357, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1357, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_128mpfr_equal_p(__pyx_self, __pyx_v_op1, __pyx_v_op2); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_128mpfr_equal_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_equal_p", 1); + + /* "mpfr.pyx":1364 + * + * """ + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * return bool(cmpfr.mpfr_equal_p(&op1._value, &op2._value)) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1364, __pyx_L1_error) + + /* "mpfr.pyx":1365 + * """ + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_equal_p(&op1._value, &op2._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1365, __pyx_L1_error) + + /* "mpfr.pyx":1366 + * check_initialized(op1) + * check_initialized(op2) + * return bool(cmpfr.mpfr_equal_p(&op1._value, &op2._value)) # <<<<<<<<<<<<<< + * + * def mpfr_lessgreater_p(Mpfr_t op1 not None, Mpfr_t op2 not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_equal_p((&__pyx_v_op1->_value), (&__pyx_v_op2->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1366, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1357 + * return bool(cmpfr.mpfr_lessequal_p(&op1._value, &op2._value)) + * + * def mpfr_equal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 == op2 and False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_equal_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1368 + * return bool(cmpfr.mpfr_equal_p(&op1._value, &op2._value)) + * + * def mpfr_lessgreater_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 < op2 or op1 > op2 and False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_131mpfr_lessgreater_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_130mpfr_lessgreater_p, "mpfr_lessgreater_p(Mpfr_t op1, Mpfr_t op2)\n\n Return True if op1 < op2 or op1 > op2 and False otherwise.\n\n This function returns False whenever op1 and/or op2 is a NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_131mpfr_lessgreater_p = {"mpfr_lessgreater_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_131mpfr_lessgreater_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_130mpfr_lessgreater_p}; +static PyObject *__pyx_pw_4mpfr_131mpfr_lessgreater_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_lessgreater_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op1,&__pyx_n_s_op2,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1368, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1368, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_lessgreater_p", 1, 2, 2, 1); __PYX_ERR(1, 1368, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_lessgreater_p") < 0)) __PYX_ERR(1, 1368, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_lessgreater_p", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 1368, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_lessgreater_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1368, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1368, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_130mpfr_lessgreater_p(__pyx_self, __pyx_v_op1, __pyx_v_op2); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_130mpfr_lessgreater_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_lessgreater_p", 1); + + /* "mpfr.pyx":1375 + * + * """ + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * return bool(cmpfr.mpfr_lessgreater_p(&op1._value, &op2._value)) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1375, __pyx_L1_error) + + /* "mpfr.pyx":1376 + * """ + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_lessgreater_p(&op1._value, &op2._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1376, __pyx_L1_error) + + /* "mpfr.pyx":1377 + * check_initialized(op1) + * check_initialized(op2) + * return bool(cmpfr.mpfr_lessgreater_p(&op1._value, &op2._value)) # <<<<<<<<<<<<<< + * + * def mpfr_unordered_p(Mpfr_t op1 not None, Mpfr_t op2 not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_lessgreater_p((&__pyx_v_op1->_value), (&__pyx_v_op2->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1377, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1368 + * return bool(cmpfr.mpfr_equal_p(&op1._value, &op2._value)) + * + * def mpfr_lessgreater_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 < op2 or op1 > op2 and False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_lessgreater_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1379 + * return bool(cmpfr.mpfr_lessgreater_p(&op1._value, &op2._value)) + * + * def mpfr_unordered_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 or op2 is a NaN and False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_133mpfr_unordered_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_132mpfr_unordered_p, "mpfr_unordered_p(Mpfr_t op1, Mpfr_t op2)\n\n Return True if op1 or op2 is a NaN and False otherwise.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_133mpfr_unordered_p = {"mpfr_unordered_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_133mpfr_unordered_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_132mpfr_unordered_p}; +static PyObject *__pyx_pw_4mpfr_133mpfr_unordered_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_unordered_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op1,&__pyx_n_s_op2,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1379, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1379, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_unordered_p", 1, 2, 2, 1); __PYX_ERR(1, 1379, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_unordered_p") < 0)) __PYX_ERR(1, 1379, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_unordered_p", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 1379, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_unordered_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1379, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1379, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_132mpfr_unordered_p(__pyx_self, __pyx_v_op1, __pyx_v_op2); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_132mpfr_unordered_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_unordered_p", 1); + + /* "mpfr.pyx":1384 + * + * """ + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * return bool(cmpfr.mpfr_unordered_p(&op1._value, &op2._value)) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1384, __pyx_L1_error) + + /* "mpfr.pyx":1385 + * """ + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_unordered_p(&op1._value, &op2._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1385, __pyx_L1_error) + + /* "mpfr.pyx":1386 + * check_initialized(op1) + * check_initialized(op2) + * return bool(cmpfr.mpfr_unordered_p(&op1._value, &op2._value)) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_unordered_p((&__pyx_v_op1->_value), (&__pyx_v_op2->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 1386, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1386, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1379 + * return bool(cmpfr.mpfr_lessgreater_p(&op1._value, &op2._value)) + * + * def mpfr_unordered_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 or op2 is a NaN and False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_unordered_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1393 + * ############################################################################### + * + * def mpfr_log(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the natural logarithm of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_135mpfr_log(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_134mpfr_log, "mpfr_log(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the natural logarithm of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_135mpfr_log = {"mpfr_log", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_135mpfr_log, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_134mpfr_log}; +static PyObject *__pyx_pw_4mpfr_135mpfr_log(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_log (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1393, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1393, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_log", 1, 3, 3, 1); __PYX_ERR(1, 1393, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1393, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_log", 1, 3, 3, 2); __PYX_ERR(1, 1393, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_log") < 0)) __PYX_ERR(1, 1393, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1393, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_log", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1393, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_log", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1393, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1393, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_134mpfr_log(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_134mpfr_log(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_log", 1); + + /* "mpfr.pyx":1398 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1398, __pyx_L1_error) + + /* "mpfr.pyx":1399 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_log(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1399, __pyx_L1_error) + + /* "mpfr.pyx":1400 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_log(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1400, __pyx_L1_error) + + /* "mpfr.pyx":1401 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_log(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_log_ui(Mpfr_t rop not None, unsigned long op, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_log((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1393 + * ############################################################################### + * + * def mpfr_log(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the natural logarithm of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_log", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1403 + * return cmpfr.mpfr_log(&rop._value, &op._value, rnd) + * + * def mpfr_log_ui(Mpfr_t rop not None, unsigned long op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the natural logarithm of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_137mpfr_log_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_136mpfr_log_ui, "mpfr_log_ui(Mpfr_t rop, unsigned long op, mpfr_rnd_t rnd)\n\n Set rop to the natural logarithm of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_137mpfr_log_ui = {"mpfr_log_ui", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_137mpfr_log_ui, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_136mpfr_log_ui}; +static PyObject *__pyx_pw_4mpfr_137mpfr_log_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + unsigned long __pyx_v_op; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_log_ui (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1403, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1403, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_log_ui", 1, 3, 3, 1); __PYX_ERR(1, 1403, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1403, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_log_ui", 1, 3, 3, 2); __PYX_ERR(1, 1403, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_log_ui") < 0)) __PYX_ERR(1, 1403, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_op == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1403, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1403, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_log_ui", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1403, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_log_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1403, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_136mpfr_log_ui(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_136mpfr_log_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, unsigned long __pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_log_ui", 1); + + /* "mpfr.pyx":1408 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_log_ui(&rop._value, op, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1408, __pyx_L1_error) + + /* "mpfr.pyx":1409 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_log_ui(&rop._value, op, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1409, __pyx_L1_error) + + /* "mpfr.pyx":1410 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_log_ui(&rop._value, op, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_log2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_log_ui((&__pyx_v_rop->_value), __pyx_v_op, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1410, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1403 + * return cmpfr.mpfr_log(&rop._value, &op._value, rnd) + * + * def mpfr_log_ui(Mpfr_t rop not None, unsigned long op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the natural logarithm of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_log_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1412 + * return cmpfr.mpfr_log_ui(&rop._value, op, rnd) + * + * def mpfr_log2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the base-two logarithm of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_139mpfr_log2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_138mpfr_log2, "mpfr_log2(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the base-two logarithm of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_139mpfr_log2 = {"mpfr_log2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_139mpfr_log2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_138mpfr_log2}; +static PyObject *__pyx_pw_4mpfr_139mpfr_log2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_log2 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1412, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1412, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_log2", 1, 3, 3, 1); __PYX_ERR(1, 1412, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1412, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_log2", 1, 3, 3, 2); __PYX_ERR(1, 1412, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_log2") < 0)) __PYX_ERR(1, 1412, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1412, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_log2", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1412, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_log2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1412, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1412, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_138mpfr_log2(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_138mpfr_log2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_log2", 1); + + /* "mpfr.pyx":1417 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1417, __pyx_L1_error) + + /* "mpfr.pyx":1418 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_log2(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1418, __pyx_L1_error) + + /* "mpfr.pyx":1419 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_log2(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1419, __pyx_L1_error) + + /* "mpfr.pyx":1420 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_log2(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_log10(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_log2((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1412 + * return cmpfr.mpfr_log_ui(&rop._value, op, rnd) + * + * def mpfr_log2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the base-two logarithm of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_log2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1422 + * return cmpfr.mpfr_log2(&rop._value, &op._value, rnd) + * + * def mpfr_log10(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the base-ten logarithm of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_141mpfr_log10(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_140mpfr_log10, "mpfr_log10(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the base-ten logarithm of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_141mpfr_log10 = {"mpfr_log10", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_141mpfr_log10, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_140mpfr_log10}; +static PyObject *__pyx_pw_4mpfr_141mpfr_log10(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_log10 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1422, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1422, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_log10", 1, 3, 3, 1); __PYX_ERR(1, 1422, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1422, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_log10", 1, 3, 3, 2); __PYX_ERR(1, 1422, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_log10") < 0)) __PYX_ERR(1, 1422, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1422, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_log10", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1422, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_log10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1422, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1422, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_140mpfr_log10(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_140mpfr_log10(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_log10", 1); + + /* "mpfr.pyx":1427 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1427, __pyx_L1_error) + + /* "mpfr.pyx":1428 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_log10(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1428, __pyx_L1_error) + + /* "mpfr.pyx":1429 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_log10(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1429, __pyx_L1_error) + + /* "mpfr.pyx":1430 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_log10(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_log1p(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_log10((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1430, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1422 + * return cmpfr.mpfr_log2(&rop._value, &op._value, rnd) + * + * def mpfr_log10(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the base-ten logarithm of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_log10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1432 + * return cmpfr.mpfr_log10(&rop._value, &op._value, rnd) + * + * def mpfr_log1p(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the logarithm of one plus op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_143mpfr_log1p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_142mpfr_log1p, "mpfr_log1p(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the logarithm of one plus op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_143mpfr_log1p = {"mpfr_log1p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_143mpfr_log1p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_142mpfr_log1p}; +static PyObject *__pyx_pw_4mpfr_143mpfr_log1p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_log1p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1432, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1432, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_log1p", 1, 3, 3, 1); __PYX_ERR(1, 1432, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1432, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_log1p", 1, 3, 3, 2); __PYX_ERR(1, 1432, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_log1p") < 0)) __PYX_ERR(1, 1432, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1432, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_log1p", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1432, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_log1p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1432, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1432, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_142mpfr_log1p(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_142mpfr_log1p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_log1p", 1); + + /* "mpfr.pyx":1437 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1437, __pyx_L1_error) + + /* "mpfr.pyx":1438 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_log1p(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1438, __pyx_L1_error) + + /* "mpfr.pyx":1439 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_log1p(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1439, __pyx_L1_error) + + /* "mpfr.pyx":1440 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_log1p(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_exp(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_log1p((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1440, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1432 + * return cmpfr.mpfr_log10(&rop._value, &op._value, rnd) + * + * def mpfr_log1p(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the logarithm of one plus op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_log1p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1442 + * return cmpfr.mpfr_log1p(&rop._value, &op._value, rnd) + * + * def mpfr_exp(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_145mpfr_exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_144mpfr_exp, "mpfr_exp(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the exponential of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_145mpfr_exp = {"mpfr_exp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_145mpfr_exp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_144mpfr_exp}; +static PyObject *__pyx_pw_4mpfr_145mpfr_exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_exp (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1442, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1442, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_exp", 1, 3, 3, 1); __PYX_ERR(1, 1442, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1442, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_exp", 1, 3, 3, 2); __PYX_ERR(1, 1442, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_exp") < 0)) __PYX_ERR(1, 1442, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1442, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_exp", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1442, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1442, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1442, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_144mpfr_exp(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_144mpfr_exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_exp", 1); + + /* "mpfr.pyx":1447 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1447, __pyx_L1_error) + + /* "mpfr.pyx":1448 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_exp(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1448, __pyx_L1_error) + + /* "mpfr.pyx":1449 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_exp(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1449, __pyx_L1_error) + + /* "mpfr.pyx":1450 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_exp(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_exp2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_exp((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1442 + * return cmpfr.mpfr_log1p(&rop._value, &op._value, rnd) + * + * def mpfr_exp(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1452 + * return cmpfr.mpfr_exp(&rop._value, &op._value, rnd) + * + * def mpfr_exp2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to two raised to the power op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_147mpfr_exp2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_146mpfr_exp2, "mpfr_exp2(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to two raised to the power op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_147mpfr_exp2 = {"mpfr_exp2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_147mpfr_exp2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_146mpfr_exp2}; +static PyObject *__pyx_pw_4mpfr_147mpfr_exp2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_exp2 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1452, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1452, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_exp2", 1, 3, 3, 1); __PYX_ERR(1, 1452, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1452, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_exp2", 1, 3, 3, 2); __PYX_ERR(1, 1452, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_exp2") < 0)) __PYX_ERR(1, 1452, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1452, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_exp2", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1452, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_exp2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1452, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1452, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_146mpfr_exp2(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_146mpfr_exp2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_exp2", 1); + + /* "mpfr.pyx":1457 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1457, __pyx_L1_error) + + /* "mpfr.pyx":1458 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_exp2(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1458, __pyx_L1_error) + + /* "mpfr.pyx":1459 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_exp2(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1459, __pyx_L1_error) + + /* "mpfr.pyx":1460 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_exp2(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_exp10(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_exp2((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1452 + * return cmpfr.mpfr_exp(&rop._value, &op._value, rnd) + * + * def mpfr_exp2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to two raised to the power op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_exp2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1462 + * return cmpfr.mpfr_exp2(&rop._value, &op._value, rnd) + * + * def mpfr_exp10(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to ten raised to the power op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_149mpfr_exp10(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_148mpfr_exp10, "mpfr_exp10(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to ten raised to the power op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_149mpfr_exp10 = {"mpfr_exp10", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_149mpfr_exp10, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_148mpfr_exp10}; +static PyObject *__pyx_pw_4mpfr_149mpfr_exp10(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_exp10 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1462, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1462, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_exp10", 1, 3, 3, 1); __PYX_ERR(1, 1462, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1462, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_exp10", 1, 3, 3, 2); __PYX_ERR(1, 1462, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_exp10") < 0)) __PYX_ERR(1, 1462, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1462, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_exp10", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1462, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_exp10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1462, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1462, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_148mpfr_exp10(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_148mpfr_exp10(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_exp10", 1); + + /* "mpfr.pyx":1467 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1467, __pyx_L1_error) + + /* "mpfr.pyx":1468 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_exp10(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1468, __pyx_L1_error) + + /* "mpfr.pyx":1469 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_exp10(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1469, __pyx_L1_error) + + /* "mpfr.pyx":1470 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_exp10(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_expm1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_exp10((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1462 + * return cmpfr.mpfr_exp2(&rop._value, &op._value, rnd) + * + * def mpfr_exp10(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to ten raised to the power op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_exp10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1472 + * return cmpfr.mpfr_exp10(&rop._value, &op._value, rnd) + * + * def mpfr_expm1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential of op followed by a subtraction by one, rounded + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_151mpfr_expm1(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_150mpfr_expm1, "mpfr_expm1(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the exponential of op followed by a subtraction by one, rounded\n in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_151mpfr_expm1 = {"mpfr_expm1", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_151mpfr_expm1, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_150mpfr_expm1}; +static PyObject *__pyx_pw_4mpfr_151mpfr_expm1(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_expm1 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1472, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1472, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_expm1", 1, 3, 3, 1); __PYX_ERR(1, 1472, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1472, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_expm1", 1, 3, 3, 2); __PYX_ERR(1, 1472, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_expm1") < 0)) __PYX_ERR(1, 1472, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1472, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_expm1", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1472, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_expm1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1472, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1472, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_150mpfr_expm1(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_150mpfr_expm1(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_expm1", 1); + + /* "mpfr.pyx":1478 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1478, __pyx_L1_error) + + /* "mpfr.pyx":1479 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_expm1(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1479, __pyx_L1_error) + + /* "mpfr.pyx":1480 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_expm1(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1480, __pyx_L1_error) + + /* "mpfr.pyx":1481 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_expm1(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_cos(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_expm1((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1472 + * return cmpfr.mpfr_exp10(&rop._value, &op._value, rnd) + * + * def mpfr_expm1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential of op followed by a subtraction by one, rounded + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_expm1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1483 + * return cmpfr.mpfr_expm1(&rop._value, &op._value, rnd) + * + * def mpfr_cos(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cosine of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_153mpfr_cos(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_152mpfr_cos, "mpfr_cos(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the cosine of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_153mpfr_cos = {"mpfr_cos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_153mpfr_cos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_152mpfr_cos}; +static PyObject *__pyx_pw_4mpfr_153mpfr_cos(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_cos (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1483, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1483, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_cos", 1, 3, 3, 1); __PYX_ERR(1, 1483, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1483, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_cos", 1, 3, 3, 2); __PYX_ERR(1, 1483, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_cos") < 0)) __PYX_ERR(1, 1483, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1483, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_cos", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1483, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_cos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1483, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1483, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_152mpfr_cos(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_152mpfr_cos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_cos", 1); + + /* "mpfr.pyx":1488 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1488, __pyx_L1_error) + + /* "mpfr.pyx":1489 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_cos(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1489, __pyx_L1_error) + + /* "mpfr.pyx":1490 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_cos(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1490, __pyx_L1_error) + + /* "mpfr.pyx":1491 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_cos(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_sin(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_cos((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1483 + * return cmpfr.mpfr_expm1(&rop._value, &op._value, rnd) + * + * def mpfr_cos(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cosine of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_cos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1493 + * return cmpfr.mpfr_cos(&rop._value, &op._value, rnd) + * + * def mpfr_sin(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the sine of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_155mpfr_sin(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_154mpfr_sin, "mpfr_sin(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the sine of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_155mpfr_sin = {"mpfr_sin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_155mpfr_sin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_154mpfr_sin}; +static PyObject *__pyx_pw_4mpfr_155mpfr_sin(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_sin (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1493, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1493, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sin", 1, 3, 3, 1); __PYX_ERR(1, 1493, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1493, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sin", 1, 3, 3, 2); __PYX_ERR(1, 1493, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_sin") < 0)) __PYX_ERR(1, 1493, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1493, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_sin", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1493, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_sin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1493, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1493, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_154mpfr_sin(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_154mpfr_sin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_sin", 1); + + /* "mpfr.pyx":1498 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1498, __pyx_L1_error) + + /* "mpfr.pyx":1499 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sin(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1499, __pyx_L1_error) + + /* "mpfr.pyx":1500 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_sin(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1500, __pyx_L1_error) + + /* "mpfr.pyx":1501 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sin(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_tan(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_sin((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1493 + * return cmpfr.mpfr_cos(&rop._value, &op._value, rnd) + * + * def mpfr_sin(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the sine of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_sin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1503 + * return cmpfr.mpfr_sin(&rop._value, &op._value, rnd) + * + * def mpfr_tan(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the tangent of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_157mpfr_tan(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_156mpfr_tan, "mpfr_tan(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the tangent of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_157mpfr_tan = {"mpfr_tan", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_157mpfr_tan, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_156mpfr_tan}; +static PyObject *__pyx_pw_4mpfr_157mpfr_tan(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_tan (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1503, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1503, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_tan", 1, 3, 3, 1); __PYX_ERR(1, 1503, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1503, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_tan", 1, 3, 3, 2); __PYX_ERR(1, 1503, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_tan") < 0)) __PYX_ERR(1, 1503, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1503, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_tan", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1503, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_tan", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1503, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1503, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_156mpfr_tan(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_156mpfr_tan(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_tan", 1); + + /* "mpfr.pyx":1508 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1508, __pyx_L1_error) + + /* "mpfr.pyx":1509 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_tan(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1509, __pyx_L1_error) + + /* "mpfr.pyx":1510 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_tan(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1510, __pyx_L1_error) + + /* "mpfr.pyx":1511 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_tan(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_sin_cos(Mpfr_t sop not None, Mpfr_t cop not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_tan((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1503 + * return cmpfr.mpfr_sin(&rop._value, &op._value, rnd) + * + * def mpfr_tan(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the tangent of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_tan", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1513 + * return cmpfr.mpfr_tan(&rop._value, &op._value, rnd) + * + * def mpfr_sin_cos(Mpfr_t sop not None, Mpfr_t cop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_159mpfr_sin_cos(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_158mpfr_sin_cos, "mpfr_sin_cos(Mpfr_t sop, Mpfr_t cop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Compute sin(op) and cos(op), rounded in the direction rnd.\n\n Set simultaneously sop to the sine of op and cop to the cosine of op,\n rounded in the direction rnd with the corresponding precisions of sop and\n cop, which must be different variables.\n\n Returns a pair (sin_ternary, cos_ternary) of the corresponding ternary\n values. Note that this differs from the original mpfr_sin_cos function\n from MPFR, which combines the ternary values into a single int return.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_159mpfr_sin_cos = {"mpfr_sin_cos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_159mpfr_sin_cos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_158mpfr_sin_cos}; +static PyObject *__pyx_pw_4mpfr_159mpfr_sin_cos(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_sop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_cop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_sin_cos (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sop,&__pyx_n_s_cop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1513, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1513, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sin_cos", 1, 4, 4, 1); __PYX_ERR(1, 1513, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1513, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sin_cos", 1, 4, 4, 2); __PYX_ERR(1, 1513, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1513, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sin_cos", 1, 4, 4, 3); __PYX_ERR(1, 1513, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_sin_cos") < 0)) __PYX_ERR(1, 1513, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_sop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_cop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1514, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_sin_cos", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1513, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_sin_cos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sop), __pyx_ptype_4mpfr_Mpfr_t, 0, "sop", 0))) __PYX_ERR(1, 1513, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cop), __pyx_ptype_4mpfr_Mpfr_t, 0, "cop", 0))) __PYX_ERR(1, 1513, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1514, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_158mpfr_sin_cos(__pyx_self, __pyx_v_sop, __pyx_v_cop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_158mpfr_sin_cos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_sop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_cop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + int __pyx_v_ternary_pair; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_sin_cos", 1); + + /* "mpfr.pyx":1529 + * cdef int ternary_pair + * + * check_initialized(sop) # <<<<<<<<<<<<<< + * check_initialized(cop) + * check_initialized(op) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_sop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1529, __pyx_L1_error) + + /* "mpfr.pyx":1530 + * + * check_initialized(sop) + * check_initialized(cop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_cop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1530, __pyx_L1_error) + + /* "mpfr.pyx":1531 + * check_initialized(sop) + * check_initialized(cop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * ternary_pair = cmpfr.mpfr_sin_cos( + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1531, __pyx_L1_error) + + /* "mpfr.pyx":1532 + * check_initialized(cop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * ternary_pair = cmpfr.mpfr_sin_cos( + * &sop._value, &cop._value, &op._value, rnd + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1532, __pyx_L1_error) + + /* "mpfr.pyx":1533 + * check_initialized(op) + * check_rounding_mode(rnd) + * ternary_pair = cmpfr.mpfr_sin_cos( # <<<<<<<<<<<<<< + * &sop._value, &cop._value, &op._value, rnd + * ) + */ + __pyx_v_ternary_pair = mpfr_sin_cos((&__pyx_v_sop->_value), (&__pyx_v_cop->_value), (&__pyx_v_op->_value), __pyx_v_rnd); + + /* "mpfr.pyx":1536 + * &sop._value, &cop._value, &op._value, rnd + * ) + * return decode_ternary_pair(ternary_pair) # <<<<<<<<<<<<<< + * + * def mpfr_sec(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_4mpfr_decode_ternary_pair(__pyx_v_ternary_pair); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1536, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1513 + * return cmpfr.mpfr_tan(&rop._value, &op._value, rnd) + * + * def mpfr_sin_cos(Mpfr_t sop not None, Mpfr_t cop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_sin_cos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1538 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_sec(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the secant of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_161mpfr_sec(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_160mpfr_sec, "mpfr_sec(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the secant of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_161mpfr_sec = {"mpfr_sec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_161mpfr_sec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_160mpfr_sec}; +static PyObject *__pyx_pw_4mpfr_161mpfr_sec(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_sec (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1538, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1538, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sec", 1, 3, 3, 1); __PYX_ERR(1, 1538, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1538, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sec", 1, 3, 3, 2); __PYX_ERR(1, 1538, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_sec") < 0)) __PYX_ERR(1, 1538, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1538, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_sec", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1538, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_sec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1538, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1538, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_160mpfr_sec(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_160mpfr_sec(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_sec", 1); + + /* "mpfr.pyx":1543 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1543, __pyx_L1_error) + + /* "mpfr.pyx":1544 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sec(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1544, __pyx_L1_error) + + /* "mpfr.pyx":1545 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_sec(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1545, __pyx_L1_error) + + /* "mpfr.pyx":1546 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sec(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_csc(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_sec((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1538 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_sec(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the secant of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_sec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1548 + * return cmpfr.mpfr_sec(&rop._value, &op._value, rnd) + * + * def mpfr_csc(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cosecant of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_163mpfr_csc(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_162mpfr_csc, "mpfr_csc(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the cosecant of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_163mpfr_csc = {"mpfr_csc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_163mpfr_csc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_162mpfr_csc}; +static PyObject *__pyx_pw_4mpfr_163mpfr_csc(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_csc (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1548, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1548, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_csc", 1, 3, 3, 1); __PYX_ERR(1, 1548, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1548, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_csc", 1, 3, 3, 2); __PYX_ERR(1, 1548, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_csc") < 0)) __PYX_ERR(1, 1548, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1548, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_csc", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1548, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_csc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1548, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1548, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_162mpfr_csc(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_162mpfr_csc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_csc", 1); + + /* "mpfr.pyx":1553 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1553, __pyx_L1_error) + + /* "mpfr.pyx":1554 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_csc(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1554, __pyx_L1_error) + + /* "mpfr.pyx":1555 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_csc(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1555, __pyx_L1_error) + + /* "mpfr.pyx":1556 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_csc(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_cot(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_csc((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1556, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1548 + * return cmpfr.mpfr_sec(&rop._value, &op._value, rnd) + * + * def mpfr_csc(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cosecant of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_csc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1558 + * return cmpfr.mpfr_csc(&rop._value, &op._value, rnd) + * + * def mpfr_cot(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cotangent of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_165mpfr_cot(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_164mpfr_cot, "mpfr_cot(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the cotangent of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_165mpfr_cot = {"mpfr_cot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_165mpfr_cot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_164mpfr_cot}; +static PyObject *__pyx_pw_4mpfr_165mpfr_cot(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_cot (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1558, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1558, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_cot", 1, 3, 3, 1); __PYX_ERR(1, 1558, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1558, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_cot", 1, 3, 3, 2); __PYX_ERR(1, 1558, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_cot") < 0)) __PYX_ERR(1, 1558, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1558, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_cot", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1558, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_cot", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1558, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1558, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_164mpfr_cot(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_164mpfr_cot(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_cot", 1); + + /* "mpfr.pyx":1563 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1563, __pyx_L1_error) + + /* "mpfr.pyx":1564 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_cot(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1564, __pyx_L1_error) + + /* "mpfr.pyx":1565 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_cot(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1565, __pyx_L1_error) + + /* "mpfr.pyx":1566 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_cot(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_acos(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_cot((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1558 + * return cmpfr.mpfr_csc(&rop._value, &op._value, rnd) + * + * def mpfr_cot(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cotangent of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_cot", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1568 + * return cmpfr.mpfr_cot(&rop._value, &op._value, rnd) + * + * def mpfr_acos(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-cosine of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_167mpfr_acos(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_166mpfr_acos, "mpfr_acos(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the arc-cosine of op, rounded in the direction rnd.\n\n The result will usually be in the range [0, Pi]. However, note that since\n acos(-1) returns the floating-point number closest to Pi according to the\n given rounding mode, this number might not be in the output range [0, Pi];\n still, the result lies in the image of this output range by the rounding\n function.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_167mpfr_acos = {"mpfr_acos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_167mpfr_acos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_166mpfr_acos}; +static PyObject *__pyx_pw_4mpfr_167mpfr_acos(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_acos (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1568, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1568, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_acos", 1, 3, 3, 1); __PYX_ERR(1, 1568, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1568, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_acos", 1, 3, 3, 2); __PYX_ERR(1, 1568, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_acos") < 0)) __PYX_ERR(1, 1568, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1568, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_acos", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1568, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_acos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1568, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1568, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_166mpfr_acos(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_166mpfr_acos(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_acos", 1); + + /* "mpfr.pyx":1579 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1579, __pyx_L1_error) + + /* "mpfr.pyx":1580 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_acos(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1580, __pyx_L1_error) + + /* "mpfr.pyx":1581 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_acos(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1581, __pyx_L1_error) + + /* "mpfr.pyx":1582 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_acos(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_asin(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_acos((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1568 + * return cmpfr.mpfr_cot(&rop._value, &op._value, rnd) + * + * def mpfr_acos(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-cosine of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_acos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1584 + * return cmpfr.mpfr_acos(&rop._value, &op._value, rnd) + * + * def mpfr_asin(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-sine of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_169mpfr_asin(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_168mpfr_asin, "mpfr_asin(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the arc-sine of op, rounded in the direction rnd.\n\n The result will usually be in the range [-Pi/2, Pi/2]. However, note that\n since asin(-1) and asin(1) return the floating-point numbers closest to\n -Pi/2 and Pi/2 (respectively) according to the given rounding mode, these\n numbers might not be in the output range [-Pi/2, Pi/2]; still, the result\n lies in the image of this output range by the rounding function.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_169mpfr_asin = {"mpfr_asin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_169mpfr_asin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_168mpfr_asin}; +static PyObject *__pyx_pw_4mpfr_169mpfr_asin(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_asin (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1584, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1584, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_asin", 1, 3, 3, 1); __PYX_ERR(1, 1584, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1584, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_asin", 1, 3, 3, 2); __PYX_ERR(1, 1584, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_asin") < 0)) __PYX_ERR(1, 1584, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1584, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_asin", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1584, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_asin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1584, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1584, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_168mpfr_asin(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_168mpfr_asin(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_asin", 1); + + /* "mpfr.pyx":1595 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1595, __pyx_L1_error) + + /* "mpfr.pyx":1596 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_asin(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1596, __pyx_L1_error) + + /* "mpfr.pyx":1597 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_asin(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1597, __pyx_L1_error) + + /* "mpfr.pyx":1598 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_asin(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_atan(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_asin((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1584 + * return cmpfr.mpfr_acos(&rop._value, &op._value, rnd) + * + * def mpfr_asin(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-sine of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_asin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1600 + * return cmpfr.mpfr_asin(&rop._value, &op._value, rnd) + * + * def mpfr_atan(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-tangent of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_171mpfr_atan(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_170mpfr_atan, "mpfr_atan(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the arc-tangent of op, rounded in the direction rnd.\n\n The result will usually be in the range [-Pi/2, Pi/2]. However, note that\n since atan(-inf) and atan(inf) return the floating-point numbers closest to\n -Pi/2 and Pi/2 (respectively) according to the given rounding mode, these\n numbers might not be in the output range [-Pi/2, Pi/2]; still, the result\n lies in the image of this output range by the rounding function.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_171mpfr_atan = {"mpfr_atan", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_171mpfr_atan, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_170mpfr_atan}; +static PyObject *__pyx_pw_4mpfr_171mpfr_atan(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_atan (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1600, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1600, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_atan", 1, 3, 3, 1); __PYX_ERR(1, 1600, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1600, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_atan", 1, 3, 3, 2); __PYX_ERR(1, 1600, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_atan") < 0)) __PYX_ERR(1, 1600, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1600, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_atan", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1600, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_atan", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1600, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1600, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_170mpfr_atan(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_170mpfr_atan(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_atan", 1); + + /* "mpfr.pyx":1611 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1611, __pyx_L1_error) + + /* "mpfr.pyx":1612 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_atan(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1612, __pyx_L1_error) + + /* "mpfr.pyx":1613 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_atan(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1613, __pyx_L1_error) + + /* "mpfr.pyx":1614 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_atan(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_atan2(Mpfr_t rop not None, Mpfr_t y not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_atan((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1614, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1600 + * return cmpfr.mpfr_asin(&rop._value, &op._value, rnd) + * + * def mpfr_atan(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-tangent of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_atan", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1616 + * return cmpfr.mpfr_atan(&rop._value, &op._value, rnd) + * + * def mpfr_atan2(Mpfr_t rop not None, Mpfr_t y not None, # <<<<<<<<<<<<<< + * Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_173mpfr_atan2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_172mpfr_atan2, "mpfr_atan2(Mpfr_t rop, Mpfr_t y, Mpfr_t x, mpfr_rnd_t rnd)\n\n Set rop to atan(y / x) with the appropriate choice of function branch.\n\n Set rop to the arc-tangent2 of y and x, rounded in the direction rnd: if x\n > 0, atan2(y, x) = atan (y/x); if x < 0, atan2(y, x) = sign(y)*(Pi - atan\n (abs(y/x))), thus a number from -Pi to Pi. As for atan, in case the exact\n mathematical result is +Pi or -Pi, its rounded result might be outside the\n function output range.\n\n atan2(y, 0) does not raise any floating-point exception. Special values are\n handled as described in the ISO C99 and IEEE 754-2008 standards for the\n atan2 function:\n\n atan2(+0, -0) returns +Pi.\n atan2(-0, -0) returns -Pi.\n atan2(+0, +0) returns +0.\n atan2(-0, +0) returns \342\210\2220.\n atan2(+0, x) returns +Pi for x < 0.\n atan2(-0, x) returns -Pi for x < 0.\n atan2(+0, x) returns +0 for x > 0.\n atan2(-0, x) returns \342\210\2220 for x > 0.\n atan2(y, 0) returns -Pi/2 for y < 0.\n atan2(y, 0) returns +Pi/2 for y > 0.\n atan2(+Inf, -Inf) returns +3*Pi/4.\n atan2(-Inf, -Inf) returns -3*Pi/4.\n atan2(+Inf, +Inf) returns +Pi/4.\n atan2(-Inf, +Inf) returns -Pi/4.\n atan2(+Inf, x) returns +Pi/2 for finite x.\n atan2(-Inf, x) returns -Pi/2 for finite x.\n atan2(y, -Inf) returns +Pi for finite y > 0.\n atan2(y, -Inf) returns -Pi for finite y < 0.\n atan2(y, +Inf) returns +0 for finite y > 0.\n atan2(y, +Inf) returns \342\210\2220 for finite y < 0.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_173mpfr_atan2 = {"mpfr_atan2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_173mpfr_atan2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_172mpfr_atan2}; +static PyObject *__pyx_pw_4mpfr_173mpfr_atan2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_atan2 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_y,&__pyx_n_s_x,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1616, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1616, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_atan2", 1, 4, 4, 1); __PYX_ERR(1, 1616, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1616, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_atan2", 1, 4, 4, 2); __PYX_ERR(1, 1616, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1616, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_atan2", 1, 4, 4, 3); __PYX_ERR(1, 1616, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_atan2") < 0)) __PYX_ERR(1, 1616, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_y = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1617, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_atan2", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1616, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_atan2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1616, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4mpfr_Mpfr_t, 0, "y", 0))) __PYX_ERR(1, 1616, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 1617, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_172mpfr_atan2(__pyx_self, __pyx_v_rop, __pyx_v_y, __pyx_v_x, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_172mpfr_atan2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_atan2", 1); + + /* "mpfr.pyx":1653 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(y) + * check_initialized(x) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1653, __pyx_L1_error) + + /* "mpfr.pyx":1654 + * """ + * check_initialized(rop) + * check_initialized(y) # <<<<<<<<<<<<<< + * check_initialized(x) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_y); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1654, __pyx_L1_error) + + /* "mpfr.pyx":1655 + * check_initialized(rop) + * check_initialized(y) + * check_initialized(x) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_atan2(&rop._value, &y._value, &x._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1655, __pyx_L1_error) + + /* "mpfr.pyx":1656 + * check_initialized(y) + * check_initialized(x) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_atan2(&rop._value, &y._value, &x._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1656, __pyx_L1_error) + + /* "mpfr.pyx":1657 + * check_initialized(x) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_atan2(&rop._value, &y._value, &x._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_cosh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_atan2((&__pyx_v_rop->_value), (&__pyx_v_y->_value), (&__pyx_v_x->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1616 + * return cmpfr.mpfr_atan(&rop._value, &op._value, rnd) + * + * def mpfr_atan2(Mpfr_t rop not None, Mpfr_t y not None, # <<<<<<<<<<<<<< + * Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_atan2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1659 + * return cmpfr.mpfr_atan2(&rop._value, &y._value, &x._value, rnd) + * + * def mpfr_cosh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cosine of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_175mpfr_cosh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_174mpfr_cosh, "mpfr_cosh(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the hyperbolic cosine of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_175mpfr_cosh = {"mpfr_cosh", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_175mpfr_cosh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_174mpfr_cosh}; +static PyObject *__pyx_pw_4mpfr_175mpfr_cosh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_cosh (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1659, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1659, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_cosh", 1, 3, 3, 1); __PYX_ERR(1, 1659, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1659, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_cosh", 1, 3, 3, 2); __PYX_ERR(1, 1659, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_cosh") < 0)) __PYX_ERR(1, 1659, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1659, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_cosh", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1659, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_cosh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1659, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1659, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_174mpfr_cosh(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_174mpfr_cosh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_cosh", 1); + + /* "mpfr.pyx":1664 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1664, __pyx_L1_error) + + /* "mpfr.pyx":1665 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_cosh(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1665, __pyx_L1_error) + + /* "mpfr.pyx":1666 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_cosh(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1666, __pyx_L1_error) + + /* "mpfr.pyx":1667 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_cosh(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_sinh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_cosh((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1659 + * return cmpfr.mpfr_atan2(&rop._value, &y._value, &x._value, rnd) + * + * def mpfr_cosh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cosine of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_cosh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1669 + * return cmpfr.mpfr_cosh(&rop._value, &op._value, rnd) + * + * def mpfr_sinh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic sine of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_177mpfr_sinh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_176mpfr_sinh, "mpfr_sinh(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the hyperbolic sine of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_177mpfr_sinh = {"mpfr_sinh", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_177mpfr_sinh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_176mpfr_sinh}; +static PyObject *__pyx_pw_4mpfr_177mpfr_sinh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_sinh (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1669, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1669, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sinh", 1, 3, 3, 1); __PYX_ERR(1, 1669, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1669, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sinh", 1, 3, 3, 2); __PYX_ERR(1, 1669, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_sinh") < 0)) __PYX_ERR(1, 1669, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1669, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_sinh", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1669, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_sinh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1669, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1669, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_176mpfr_sinh(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_176mpfr_sinh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_sinh", 1); + + /* "mpfr.pyx":1674 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1674, __pyx_L1_error) + + /* "mpfr.pyx":1675 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sinh(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1675, __pyx_L1_error) + + /* "mpfr.pyx":1676 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_sinh(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1676, __pyx_L1_error) + + /* "mpfr.pyx":1677 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sinh(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_tanh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_sinh((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1677, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1669 + * return cmpfr.mpfr_cosh(&rop._value, &op._value, rnd) + * + * def mpfr_sinh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic sine of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_sinh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1679 + * return cmpfr.mpfr_sinh(&rop._value, &op._value, rnd) + * + * def mpfr_tanh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic tangent of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_179mpfr_tanh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_178mpfr_tanh, "mpfr_tanh(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the hyperbolic tangent of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_179mpfr_tanh = {"mpfr_tanh", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_179mpfr_tanh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_178mpfr_tanh}; +static PyObject *__pyx_pw_4mpfr_179mpfr_tanh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_tanh (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1679, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1679, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_tanh", 1, 3, 3, 1); __PYX_ERR(1, 1679, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1679, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_tanh", 1, 3, 3, 2); __PYX_ERR(1, 1679, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_tanh") < 0)) __PYX_ERR(1, 1679, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1679, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_tanh", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1679, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_tanh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1679, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1679, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_178mpfr_tanh(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_178mpfr_tanh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_tanh", 1); + + /* "mpfr.pyx":1684 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1684, __pyx_L1_error) + + /* "mpfr.pyx":1685 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_tanh(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1685, __pyx_L1_error) + + /* "mpfr.pyx":1686 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_tanh(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1686, __pyx_L1_error) + + /* "mpfr.pyx":1687 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_tanh(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_sinh_cosh(Mpfr_t sop not None, Mpfr_t cop not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_tanh((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1679 + * return cmpfr.mpfr_sinh(&rop._value, &op._value, rnd) + * + * def mpfr_tanh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic tangent of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_tanh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1689 + * return cmpfr.mpfr_tanh(&rop._value, &op._value, rnd) + * + * def mpfr_sinh_cosh(Mpfr_t sop not None, Mpfr_t cop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_181mpfr_sinh_cosh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_180mpfr_sinh_cosh, "mpfr_sinh_cosh(Mpfr_t sop, Mpfr_t cop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Compute sinh(op) and cosh(op), rounded in the direction rnd.\n\n Set simultaneously sop to the hyperbolic sine of op and cop to the\n hyperbolic cosine of op, rounded in the direction rnd with the\n corresponding precisions of sop and cop, which must be different variables.\n\n Returns a pair (sinh_ternary, cosh_ternary) of the corresponding ternary\n values. Note that this differs from the original mpfr_sinh_cosh function\n from MPFR, which combines the ternary values into a single int return.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_181mpfr_sinh_cosh = {"mpfr_sinh_cosh", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_181mpfr_sinh_cosh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_180mpfr_sinh_cosh}; +static PyObject *__pyx_pw_4mpfr_181mpfr_sinh_cosh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_sop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_cop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_sinh_cosh (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sop,&__pyx_n_s_cop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_sop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1689, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1689, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sinh_cosh", 1, 4, 4, 1); __PYX_ERR(1, 1689, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1689, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sinh_cosh", 1, 4, 4, 2); __PYX_ERR(1, 1689, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1689, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sinh_cosh", 1, 4, 4, 3); __PYX_ERR(1, 1689, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_sinh_cosh") < 0)) __PYX_ERR(1, 1689, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_sop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_cop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1690, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_sinh_cosh", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1689, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_sinh_cosh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sop), __pyx_ptype_4mpfr_Mpfr_t, 0, "sop", 0))) __PYX_ERR(1, 1689, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cop), __pyx_ptype_4mpfr_Mpfr_t, 0, "cop", 0))) __PYX_ERR(1, 1689, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1690, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_180mpfr_sinh_cosh(__pyx_self, __pyx_v_sop, __pyx_v_cop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_180mpfr_sinh_cosh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_sop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_cop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + int __pyx_v_ternary_pair; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_sinh_cosh", 1); + + /* "mpfr.pyx":1705 + * cdef int ternary_pair + * + * check_initialized(sop) # <<<<<<<<<<<<<< + * check_initialized(cop) + * check_initialized(op) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_sop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1705, __pyx_L1_error) + + /* "mpfr.pyx":1706 + * + * check_initialized(sop) + * check_initialized(cop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_cop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1706, __pyx_L1_error) + + /* "mpfr.pyx":1707 + * check_initialized(sop) + * check_initialized(cop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * ternary_pair = cmpfr.mpfr_sinh_cosh( + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1707, __pyx_L1_error) + + /* "mpfr.pyx":1708 + * check_initialized(cop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * ternary_pair = cmpfr.mpfr_sinh_cosh( + * &sop._value, &cop._value, &op._value, rnd + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1708, __pyx_L1_error) + + /* "mpfr.pyx":1709 + * check_initialized(op) + * check_rounding_mode(rnd) + * ternary_pair = cmpfr.mpfr_sinh_cosh( # <<<<<<<<<<<<<< + * &sop._value, &cop._value, &op._value, rnd + * ) + */ + __pyx_v_ternary_pair = mpfr_sinh_cosh((&__pyx_v_sop->_value), (&__pyx_v_cop->_value), (&__pyx_v_op->_value), __pyx_v_rnd); + + /* "mpfr.pyx":1712 + * &sop._value, &cop._value, &op._value, rnd + * ) + * return decode_ternary_pair(ternary_pair) # <<<<<<<<<<<<<< + * + * def mpfr_sech(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_4mpfr_decode_ternary_pair(__pyx_v_ternary_pair); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1689 + * return cmpfr.mpfr_tanh(&rop._value, &op._value, rnd) + * + * def mpfr_sinh_cosh(Mpfr_t sop not None, Mpfr_t cop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_sinh_cosh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1714 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_sech(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic secant of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_183mpfr_sech(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_182mpfr_sech, "mpfr_sech(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the hyperbolic secant of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_183mpfr_sech = {"mpfr_sech", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_183mpfr_sech, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_182mpfr_sech}; +static PyObject *__pyx_pw_4mpfr_183mpfr_sech(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_sech (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1714, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1714, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sech", 1, 3, 3, 1); __PYX_ERR(1, 1714, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1714, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sech", 1, 3, 3, 2); __PYX_ERR(1, 1714, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_sech") < 0)) __PYX_ERR(1, 1714, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1714, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_sech", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1714, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_sech", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1714, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1714, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_182mpfr_sech(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_182mpfr_sech(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_sech", 1); + + /* "mpfr.pyx":1719 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1719, __pyx_L1_error) + + /* "mpfr.pyx":1720 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sech(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1720, __pyx_L1_error) + + /* "mpfr.pyx":1721 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_sech(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1721, __pyx_L1_error) + + /* "mpfr.pyx":1722 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_sech(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_csch(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_sech((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1714 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_sech(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic secant of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_sech", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1724 + * return cmpfr.mpfr_sech(&rop._value, &op._value, rnd) + * + * def mpfr_csch(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cosecant of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_185mpfr_csch(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_184mpfr_csch, "mpfr_csch(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the hyperbolic cosecant of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_185mpfr_csch = {"mpfr_csch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_185mpfr_csch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_184mpfr_csch}; +static PyObject *__pyx_pw_4mpfr_185mpfr_csch(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_csch (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1724, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1724, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_csch", 1, 3, 3, 1); __PYX_ERR(1, 1724, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1724, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_csch", 1, 3, 3, 2); __PYX_ERR(1, 1724, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_csch") < 0)) __PYX_ERR(1, 1724, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1724, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_csch", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1724, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_csch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1724, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1724, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_184mpfr_csch(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_184mpfr_csch(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_csch", 1); + + /* "mpfr.pyx":1729 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1729, __pyx_L1_error) + + /* "mpfr.pyx":1730 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_csch(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1730, __pyx_L1_error) + + /* "mpfr.pyx":1731 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_csch(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1731, __pyx_L1_error) + + /* "mpfr.pyx":1732 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_csch(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_coth(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_csch((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1724 + * return cmpfr.mpfr_sech(&rop._value, &op._value, rnd) + * + * def mpfr_csch(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cosecant of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_csch", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1734 + * return cmpfr.mpfr_csch(&rop._value, &op._value, rnd) + * + * def mpfr_coth(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cotangent of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_187mpfr_coth(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_186mpfr_coth, "mpfr_coth(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the hyperbolic cotangent of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_187mpfr_coth = {"mpfr_coth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_187mpfr_coth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_186mpfr_coth}; +static PyObject *__pyx_pw_4mpfr_187mpfr_coth(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_coth (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1734, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1734, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_coth", 1, 3, 3, 1); __PYX_ERR(1, 1734, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1734, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_coth", 1, 3, 3, 2); __PYX_ERR(1, 1734, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_coth") < 0)) __PYX_ERR(1, 1734, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1734, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_coth", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1734, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_coth", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1734, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1734, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_186mpfr_coth(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_186mpfr_coth(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_coth", 1); + + /* "mpfr.pyx":1739 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1739, __pyx_L1_error) + + /* "mpfr.pyx":1740 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_coth(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1740, __pyx_L1_error) + + /* "mpfr.pyx":1741 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_coth(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1741, __pyx_L1_error) + + /* "mpfr.pyx":1742 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_coth(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_acosh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_coth((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1734 + * return cmpfr.mpfr_csch(&rop._value, &op._value, rnd) + * + * def mpfr_coth(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cotangent of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_coth", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1744 + * return cmpfr.mpfr_coth(&rop._value, &op._value, rnd) + * + * def mpfr_acosh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic cosine of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_189mpfr_acosh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_188mpfr_acosh, "mpfr_acosh(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the inverse hyperbolic cosine of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_189mpfr_acosh = {"mpfr_acosh", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_189mpfr_acosh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_188mpfr_acosh}; +static PyObject *__pyx_pw_4mpfr_189mpfr_acosh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_acosh (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1744, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1744, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_acosh", 1, 3, 3, 1); __PYX_ERR(1, 1744, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1744, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_acosh", 1, 3, 3, 2); __PYX_ERR(1, 1744, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_acosh") < 0)) __PYX_ERR(1, 1744, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1744, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_acosh", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1744, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_acosh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1744, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1744, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_188mpfr_acosh(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_188mpfr_acosh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_acosh", 1); + + /* "mpfr.pyx":1749 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1749, __pyx_L1_error) + + /* "mpfr.pyx":1750 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_acosh(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1750, __pyx_L1_error) + + /* "mpfr.pyx":1751 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_acosh(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1751, __pyx_L1_error) + + /* "mpfr.pyx":1752 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_acosh(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_asinh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_acosh((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1752, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1744 + * return cmpfr.mpfr_coth(&rop._value, &op._value, rnd) + * + * def mpfr_acosh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic cosine of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_acosh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1754 + * return cmpfr.mpfr_acosh(&rop._value, &op._value, rnd) + * + * def mpfr_asinh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic sine of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_191mpfr_asinh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_190mpfr_asinh, "mpfr_asinh(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the inverse hyperbolic sine of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_191mpfr_asinh = {"mpfr_asinh", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_191mpfr_asinh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_190mpfr_asinh}; +static PyObject *__pyx_pw_4mpfr_191mpfr_asinh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_asinh (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1754, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1754, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_asinh", 1, 3, 3, 1); __PYX_ERR(1, 1754, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1754, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_asinh", 1, 3, 3, 2); __PYX_ERR(1, 1754, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_asinh") < 0)) __PYX_ERR(1, 1754, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1754, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_asinh", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1754, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_asinh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1754, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1754, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_190mpfr_asinh(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_190mpfr_asinh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_asinh", 1); + + /* "mpfr.pyx":1759 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1759, __pyx_L1_error) + + /* "mpfr.pyx":1760 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_asinh(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1760, __pyx_L1_error) + + /* "mpfr.pyx":1761 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_asinh(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1761, __pyx_L1_error) + + /* "mpfr.pyx":1762 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_asinh(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_atanh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_asinh((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1762, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1754 + * return cmpfr.mpfr_acosh(&rop._value, &op._value, rnd) + * + * def mpfr_asinh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic sine of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_asinh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1764 + * return cmpfr.mpfr_asinh(&rop._value, &op._value, rnd) + * + * def mpfr_atanh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic tangent of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_193mpfr_atanh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_192mpfr_atanh, "mpfr_atanh(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the inverse hyperbolic tangent of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_193mpfr_atanh = {"mpfr_atanh", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_193mpfr_atanh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_192mpfr_atanh}; +static PyObject *__pyx_pw_4mpfr_193mpfr_atanh(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_atanh (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1764, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1764, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_atanh", 1, 3, 3, 1); __PYX_ERR(1, 1764, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1764, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_atanh", 1, 3, 3, 2); __PYX_ERR(1, 1764, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_atanh") < 0)) __PYX_ERR(1, 1764, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1764, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_atanh", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1764, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_atanh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1764, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1764, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_192mpfr_atanh(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_192mpfr_atanh(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_atanh", 1); + + /* "mpfr.pyx":1769 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1769, __pyx_L1_error) + + /* "mpfr.pyx":1770 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_atanh(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1770, __pyx_L1_error) + + /* "mpfr.pyx":1771 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_atanh(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1771, __pyx_L1_error) + + /* "mpfr.pyx":1772 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_atanh(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_fac_ui(Mpfr_t rop not None, unsigned long int op, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_atanh((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1772, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1764 + * return cmpfr.mpfr_asinh(&rop._value, &op._value, rnd) + * + * def mpfr_atanh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic tangent of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_atanh", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1774 + * return cmpfr.mpfr_atanh(&rop._value, &op._value, rnd) + * + * def mpfr_fac_ui(Mpfr_t rop not None, unsigned long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the factorial of op, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_195mpfr_fac_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_194mpfr_fac_ui, "mpfr_fac_ui(Mpfr_t rop, unsigned long op, mpfr_rnd_t rnd)\n\n Set rop to the factorial of op, rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_195mpfr_fac_ui = {"mpfr_fac_ui", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_195mpfr_fac_ui, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_194mpfr_fac_ui}; +static PyObject *__pyx_pw_4mpfr_195mpfr_fac_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + unsigned long __pyx_v_op; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_fac_ui (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1774, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1774, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fac_ui", 1, 3, 3, 1); __PYX_ERR(1, 1774, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1774, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fac_ui", 1, 3, 3, 2); __PYX_ERR(1, 1774, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_fac_ui") < 0)) __PYX_ERR(1, 1774, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_op == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1774, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1774, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_fac_ui", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1774, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_fac_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1774, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_194mpfr_fac_ui(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_194mpfr_fac_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, unsigned long __pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_fac_ui", 1); + + /* "mpfr.pyx":1779 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fac_ui(&rop._value, op, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1779, __pyx_L1_error) + + /* "mpfr.pyx":1780 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_fac_ui(&rop._value, op, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1780, __pyx_L1_error) + + /* "mpfr.pyx":1781 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fac_ui(&rop._value, op, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_eint(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_fac_ui((&__pyx_v_rop->_value), __pyx_v_op, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1774 + * return cmpfr.mpfr_atanh(&rop._value, &op._value, rnd) + * + * def mpfr_fac_ui(Mpfr_t rop not None, unsigned long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the factorial of op, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_fac_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1783 + * return cmpfr.mpfr_fac_ui(&rop._value, op, rnd) + * + * def mpfr_eint(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential integral of op, rounded in the direction + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_197mpfr_eint(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_196mpfr_eint, "mpfr_eint(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the exponential integral of op, rounded in the direction\n rnd.\n\n For positive op, the exponential integral is the sum of Euler's constant,\n of the logarithm of op, and of the sum for k from 1 to infinity of op to\n the power k, divided by k and factorial(k). For negative op, rop is set to\n NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_197mpfr_eint = {"mpfr_eint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_197mpfr_eint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_196mpfr_eint}; +static PyObject *__pyx_pw_4mpfr_197mpfr_eint(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_eint (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1783, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1783, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_eint", 1, 3, 3, 1); __PYX_ERR(1, 1783, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1783, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_eint", 1, 3, 3, 2); __PYX_ERR(1, 1783, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_eint") < 0)) __PYX_ERR(1, 1783, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1783, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_eint", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1783, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_eint", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1783, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1783, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_196mpfr_eint(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_196mpfr_eint(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_eint", 1); + + /* "mpfr.pyx":1794 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1794, __pyx_L1_error) + + /* "mpfr.pyx":1795 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_eint(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1795, __pyx_L1_error) + + /* "mpfr.pyx":1796 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_eint(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1796, __pyx_L1_error) + + /* "mpfr.pyx":1797 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_eint(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_li2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_eint((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1797, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1783 + * return cmpfr.mpfr_fac_ui(&rop._value, op, rnd) + * + * def mpfr_eint(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential integral of op, rounded in the direction + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_eint", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1799 + * return cmpfr.mpfr_eint(&rop._value, &op._value, rnd) + * + * def mpfr_li2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to real part of the dilogarithm of op, rounded in the direction + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_199mpfr_li2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_198mpfr_li2, "mpfr_li2(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to real part of the dilogarithm of op, rounded in the direction\n rnd.\n\n MPFR defines the dilogarithm function as the integral of -log(1-t)/t from 0\n to op.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_199mpfr_li2 = {"mpfr_li2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_199mpfr_li2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_198mpfr_li2}; +static PyObject *__pyx_pw_4mpfr_199mpfr_li2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_li2 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1799, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1799, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_li2", 1, 3, 3, 1); __PYX_ERR(1, 1799, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1799, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_li2", 1, 3, 3, 2); __PYX_ERR(1, 1799, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_li2") < 0)) __PYX_ERR(1, 1799, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1799, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_li2", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1799, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_li2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1799, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1799, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_198mpfr_li2(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_198mpfr_li2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_li2", 1); + + /* "mpfr.pyx":1808 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1808, __pyx_L1_error) + + /* "mpfr.pyx":1809 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_li2(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1809, __pyx_L1_error) + + /* "mpfr.pyx":1810 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_li2(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1810, __pyx_L1_error) + + /* "mpfr.pyx":1811 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_li2(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_gamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_li2((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1811, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1799 + * return cmpfr.mpfr_eint(&rop._value, &op._value, rnd) + * + * def mpfr_li2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to real part of the dilogarithm of op, rounded in the direction + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_li2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1813 + * return cmpfr.mpfr_li2(&rop._value, &op._value, rnd) + * + * def mpfr_gamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Gamma function on op, rounded in the direction + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_201mpfr_gamma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_200mpfr_gamma, "mpfr_gamma(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the Gamma function on op, rounded in the direction\n rnd.\n\n When op is a negative integer, rop is set to NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_201mpfr_gamma = {"mpfr_gamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_201mpfr_gamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_200mpfr_gamma}; +static PyObject *__pyx_pw_4mpfr_201mpfr_gamma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_gamma (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1813, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1813, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_gamma", 1, 3, 3, 1); __PYX_ERR(1, 1813, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1813, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_gamma", 1, 3, 3, 2); __PYX_ERR(1, 1813, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_gamma") < 0)) __PYX_ERR(1, 1813, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1813, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_gamma", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1813, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1813, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1813, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_200mpfr_gamma(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_200mpfr_gamma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_gamma", 1); + + /* "mpfr.pyx":1821 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1821, __pyx_L1_error) + + /* "mpfr.pyx":1822 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_gamma(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1822, __pyx_L1_error) + + /* "mpfr.pyx":1823 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_gamma(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1823, __pyx_L1_error) + + /* "mpfr.pyx":1824 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_gamma(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_gamma_inc(Mpfr_t rop not None, Mpfr_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_gamma((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1813 + * return cmpfr.mpfr_li2(&rop._value, &op._value, rnd) + * + * def mpfr_gamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Gamma function on op, rounded in the direction + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1826 + * return cmpfr.mpfr_gamma(&rop._value, &op._value, rnd) + * + * def mpfr_gamma_inc(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_203mpfr_gamma_inc(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_202mpfr_gamma_inc, "mpfr_gamma_inc(Mpfr_t rop, Mpfr_t op, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to the value of the incomplete Gamma function on op and op2,\n rounded in the direction rnd. (In the literature, mpfr_gamma_inc is\n called the upper incomplete Gamma function or the complementary incomplete\n Gamma function.) When op2 is zero and op is a negative integer, rop is\n set to NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_203mpfr_gamma_inc = {"mpfr_gamma_inc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_203mpfr_gamma_inc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_202mpfr_gamma_inc}; +static PyObject *__pyx_pw_4mpfr_203mpfr_gamma_inc(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_gamma_inc (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1826, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1826, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_gamma_inc", 1, 4, 4, 1); __PYX_ERR(1, 1826, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1826, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_gamma_inc", 1, 4, 4, 2); __PYX_ERR(1, 1826, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1826, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_gamma_inc", 1, 4, 4, 3); __PYX_ERR(1, 1826, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_gamma_inc") < 0)) __PYX_ERR(1, 1826, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1827, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_gamma_inc", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1826, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_gamma_inc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1826, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1826, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1827, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_202mpfr_gamma_inc(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_202mpfr_gamma_inc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_gamma_inc", 1); + + /* "mpfr.pyx":1836 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1836, __pyx_L1_error) + + /* "mpfr.pyx":1837 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1837, __pyx_L1_error) + + /* "mpfr.pyx":1838 + * check_initialized(rop) + * check_initialized(op) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_gamma_inc(&rop._value, &op._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1838, __pyx_L1_error) + + /* "mpfr.pyx":1839 + * check_initialized(op) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_gamma_inc(&rop._value, &op._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1839, __pyx_L1_error) + + /* "mpfr.pyx":1840 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_gamma_inc(&rop._value, &op._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_lngamma(Mpfr_t rop not None, Mpfr_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_gamma_inc((&__pyx_v_rop->_value), (&__pyx_v_op->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1826 + * return cmpfr.mpfr_gamma(&rop._value, &op._value, rnd) + * + * def mpfr_gamma_inc(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_gamma_inc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1842 + * return cmpfr.mpfr_gamma_inc(&rop._value, &op._value, &op2._value, rnd) + * + * def mpfr_lngamma(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_205mpfr_lngamma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_204mpfr_lngamma, "mpfr_lngamma(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the logarithm of the Gamma function on op, rounded\n in the direction rnd.\n\n When \342\210\2222k\342\210\2221 <= op <= \342\210\2222k, k being a non-negative integer, rop is set to\n NaN. See also mpfr_lgamma.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_205mpfr_lngamma = {"mpfr_lngamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_205mpfr_lngamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_204mpfr_lngamma}; +static PyObject *__pyx_pw_4mpfr_205mpfr_lngamma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_lngamma (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1842, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1842, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_lngamma", 1, 3, 3, 1); __PYX_ERR(1, 1842, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1842, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_lngamma", 1, 3, 3, 2); __PYX_ERR(1, 1842, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_lngamma") < 0)) __PYX_ERR(1, 1842, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1843, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_lngamma", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1842, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_lngamma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1842, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1842, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_204mpfr_lngamma(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_204mpfr_lngamma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_lngamma", 1); + + /* "mpfr.pyx":1852 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1852, __pyx_L1_error) + + /* "mpfr.pyx":1853 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_lngamma(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1853, __pyx_L1_error) + + /* "mpfr.pyx":1854 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_lngamma(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1854, __pyx_L1_error) + + /* "mpfr.pyx":1855 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_lngamma(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_lgamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_lngamma((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1842 + * return cmpfr.mpfr_gamma_inc(&rop._value, &op._value, &op2._value, rnd) + * + * def mpfr_lngamma(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_lngamma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1857 + * return cmpfr.mpfr_lngamma(&rop._value, &op._value, rnd) + * + * def mpfr_lgamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the logarithm of the absolute value of the Gamma + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_207mpfr_lgamma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_206mpfr_lgamma, "mpfr_lgamma(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the logarithm of the absolute value of the Gamma\n function on op, rounded in the direction rnd.\n\n Return a pair (ternary, sign) where ternary is the usual ternary value and\n sign is the sign (1 or -1) of Gamma(rop).\n\n When op is an infinity or a non-positive integer, set rop to +Inf. When op\n is NaN, \342\210\222Inf or a negative integer, signp is undefined, and when op is \302\2610,\n signp is the sign of the zero.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_207mpfr_lgamma = {"mpfr_lgamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_207mpfr_lgamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_206mpfr_lgamma}; +static PyObject *__pyx_pw_4mpfr_207mpfr_lgamma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_lgamma (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1857, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1857, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_lgamma", 1, 3, 3, 1); __PYX_ERR(1, 1857, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1857, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_lgamma", 1, 3, 3, 2); __PYX_ERR(1, 1857, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_lgamma") < 0)) __PYX_ERR(1, 1857, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1857, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_lgamma", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1857, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_lgamma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1857, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1857, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_206mpfr_lgamma(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_206mpfr_lgamma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + int __pyx_v_signp; + int __pyx_v_ternary; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_lgamma", 1); + + /* "mpfr.pyx":1872 + * cdef int signp + * + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1872, __pyx_L1_error) + + /* "mpfr.pyx":1873 + * + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * ternary = cmpfr.mpfr_lgamma( + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1873, __pyx_L1_error) + + /* "mpfr.pyx":1874 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * ternary = cmpfr.mpfr_lgamma( + * &rop._value, &signp, &op._value, rnd + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1874, __pyx_L1_error) + + /* "mpfr.pyx":1875 + * check_initialized(op) + * check_rounding_mode(rnd) + * ternary = cmpfr.mpfr_lgamma( # <<<<<<<<<<<<<< + * &rop._value, &signp, &op._value, rnd + * ) + */ + __pyx_v_ternary = mpfr_lgamma((&__pyx_v_rop->_value), (&__pyx_v_signp), (&__pyx_v_op->_value), __pyx_v_rnd); + + /* "mpfr.pyx":1878 + * &rop._value, &signp, &op._value, rnd + * ) + * return ternary, signp # <<<<<<<<<<<<<< + * + * def mpfr_digamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ternary); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_signp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(1, 1878, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(1, 1878, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1857 + * return cmpfr.mpfr_lngamma(&rop._value, &op._value, rnd) + * + * def mpfr_lgamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the logarithm of the absolute value of the Gamma + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("mpfr.mpfr_lgamma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1880 + * return ternary, signp + * + * def mpfr_digamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Digamma (sometimes also called Psi) function on + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_209mpfr_digamma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_208mpfr_digamma, "mpfr_digamma(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the Digamma (sometimes also called Psi) function on\n op, rounded in the direction rnd.\n\n When op is a negative integer, set rop to NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_209mpfr_digamma = {"mpfr_digamma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_209mpfr_digamma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_208mpfr_digamma}; +static PyObject *__pyx_pw_4mpfr_209mpfr_digamma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_digamma (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1880, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1880, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_digamma", 1, 3, 3, 1); __PYX_ERR(1, 1880, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1880, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_digamma", 1, 3, 3, 2); __PYX_ERR(1, 1880, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_digamma") < 0)) __PYX_ERR(1, 1880, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1880, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_digamma", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1880, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_digamma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1880, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1880, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_208mpfr_digamma(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_208mpfr_digamma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_digamma", 1); + + /* "mpfr.pyx":1888 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1888, __pyx_L1_error) + + /* "mpfr.pyx":1889 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_digamma(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1889, __pyx_L1_error) + + /* "mpfr.pyx":1890 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_digamma(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1890, __pyx_L1_error) + + /* "mpfr.pyx":1891 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_digamma(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_beta(Mpfr_t rop not None, Mpfr_t op1 not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_digamma((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1891, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1880 + * return ternary, signp + * + * def mpfr_digamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Digamma (sometimes also called Psi) function on + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_digamma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1893 + * return cmpfr.mpfr_digamma(&rop._value, &op._value, rnd) + * + * def mpfr_beta(Mpfr_t rop not None, Mpfr_t op1 not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_211mpfr_beta(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_210mpfr_beta, "mpfr_beta(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to the value of the Beta function at arguments op1 and op2.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_211mpfr_beta = {"mpfr_beta", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_211mpfr_beta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_210mpfr_beta}; +static PyObject *__pyx_pw_4mpfr_211mpfr_beta(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_beta (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1893, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1893, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_beta", 1, 4, 4, 1); __PYX_ERR(1, 1893, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1893, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_beta", 1, 4, 4, 2); __PYX_ERR(1, 1893, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1893, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_beta", 1, 4, 4, 3); __PYX_ERR(1, 1893, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_beta") < 0)) __PYX_ERR(1, 1893, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1894, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_beta", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1893, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_beta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1893, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 1893, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 1894, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_210mpfr_beta(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_210mpfr_beta(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_beta", 1); + + /* "mpfr.pyx":1899 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1899, __pyx_L1_error) + + /* "mpfr.pyx":1900 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1900, __pyx_L1_error) + + /* "mpfr.pyx":1901 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_beta(&rop._value, &op1._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1901, __pyx_L1_error) + + /* "mpfr.pyx":1902 + * check_initialized(op1) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_beta(&rop._value, &op1._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1902, __pyx_L1_error) + + /* "mpfr.pyx":1903 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_beta(&rop._value, &op1._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_zeta(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_beta((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1893 + * return cmpfr.mpfr_digamma(&rop._value, &op._value, rnd) + * + * def mpfr_beta(Mpfr_t rop not None, Mpfr_t op1 not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_beta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1905 + * return cmpfr.mpfr_beta(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_zeta(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Riemann Zeta function on op, rounded in the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_213mpfr_zeta(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_212mpfr_zeta, "mpfr_zeta(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the Riemann Zeta function on op, rounded in the\n direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_213mpfr_zeta = {"mpfr_zeta", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_213mpfr_zeta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_212mpfr_zeta}; +static PyObject *__pyx_pw_4mpfr_213mpfr_zeta(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_zeta (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1905, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1905, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_zeta", 1, 3, 3, 1); __PYX_ERR(1, 1905, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1905, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_zeta", 1, 3, 3, 2); __PYX_ERR(1, 1905, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_zeta") < 0)) __PYX_ERR(1, 1905, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1905, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_zeta", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1905, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_zeta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1905, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1905, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_212mpfr_zeta(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_212mpfr_zeta(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_zeta", 1); + + /* "mpfr.pyx":1911 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1911, __pyx_L1_error) + + /* "mpfr.pyx":1912 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_zeta(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1912, __pyx_L1_error) + + /* "mpfr.pyx":1913 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_zeta(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1913, __pyx_L1_error) + + /* "mpfr.pyx":1914 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_zeta(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_zeta_ui(Mpfr_t rop not None, unsigned long int op, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_zeta((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1905 + * return cmpfr.mpfr_beta(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_zeta(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Riemann Zeta function on op, rounded in the + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_zeta", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1916 + * return cmpfr.mpfr_zeta(&rop._value, &op._value, rnd) + * + * def mpfr_zeta_ui(Mpfr_t rop not None, unsigned long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Riemann Zeta function on op, rounded in the + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_215mpfr_zeta_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_214mpfr_zeta_ui, "mpfr_zeta_ui(Mpfr_t rop, unsigned long op, mpfr_rnd_t rnd)\n\n Set rop to the value of the Riemann Zeta function on op, rounded in the\n direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_215mpfr_zeta_ui = {"mpfr_zeta_ui", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_215mpfr_zeta_ui, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_214mpfr_zeta_ui}; +static PyObject *__pyx_pw_4mpfr_215mpfr_zeta_ui(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + unsigned long __pyx_v_op; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_zeta_ui (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1916, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1916, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_zeta_ui", 1, 3, 3, 1); __PYX_ERR(1, 1916, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1916, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_zeta_ui", 1, 3, 3, 2); __PYX_ERR(1, 1916, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_zeta_ui") < 0)) __PYX_ERR(1, 1916, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = __Pyx_PyInt_As_unsigned_long(values[1]); if (unlikely((__pyx_v_op == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1916, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1916, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_zeta_ui", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1916, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_zeta_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1916, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_214mpfr_zeta_ui(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_214mpfr_zeta_ui(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, unsigned long __pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_zeta_ui", 1); + + /* "mpfr.pyx":1922 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_zeta_ui(&rop._value, op, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1922, __pyx_L1_error) + + /* "mpfr.pyx":1923 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_zeta_ui(&rop._value, op, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1923, __pyx_L1_error) + + /* "mpfr.pyx":1924 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_zeta_ui(&rop._value, op, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_erf(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_zeta_ui((&__pyx_v_rop->_value), __pyx_v_op, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1924, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1916 + * return cmpfr.mpfr_zeta(&rop._value, &op._value, rnd) + * + * def mpfr_zeta_ui(Mpfr_t rop not None, unsigned long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Riemann Zeta function on op, rounded in the + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_zeta_ui", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1926 + * return cmpfr.mpfr_zeta_ui(&rop._value, op, rnd) + * + * def mpfr_erf(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the error function on op, rounded in the direction + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_217mpfr_erf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_216mpfr_erf, "mpfr_erf(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the error function on op, rounded in the direction\n rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_217mpfr_erf = {"mpfr_erf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_217mpfr_erf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_216mpfr_erf}; +static PyObject *__pyx_pw_4mpfr_217mpfr_erf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_erf (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1926, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1926, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_erf", 1, 3, 3, 1); __PYX_ERR(1, 1926, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1926, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_erf", 1, 3, 3, 2); __PYX_ERR(1, 1926, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_erf") < 0)) __PYX_ERR(1, 1926, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1926, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_erf", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1926, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_erf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1926, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1926, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_216mpfr_erf(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_216mpfr_erf(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_erf", 1); + + /* "mpfr.pyx":1932 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1932, __pyx_L1_error) + + /* "mpfr.pyx":1933 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_erf(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1933, __pyx_L1_error) + + /* "mpfr.pyx":1934 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_erf(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1934, __pyx_L1_error) + + /* "mpfr.pyx":1935 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_erf(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_erfc(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_erf((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1935, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1926 + * return cmpfr.mpfr_zeta_ui(&rop._value, op, rnd) + * + * def mpfr_erf(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the error function on op, rounded in the direction + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_erf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1937 + * return cmpfr.mpfr_erf(&rop._value, &op._value, rnd) + * + * def mpfr_erfc(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the the complementary error function on op, rounded + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_219mpfr_erfc(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_218mpfr_erfc, "mpfr_erfc(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the the complementary error function on op, rounded\n in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_219mpfr_erfc = {"mpfr_erfc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_219mpfr_erfc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_218mpfr_erfc}; +static PyObject *__pyx_pw_4mpfr_219mpfr_erfc(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_erfc (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1937, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1937, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_erfc", 1, 3, 3, 1); __PYX_ERR(1, 1937, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1937, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_erfc", 1, 3, 3, 2); __PYX_ERR(1, 1937, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_erfc") < 0)) __PYX_ERR(1, 1937, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1937, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_erfc", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1937, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_erfc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1937, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1937, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_218mpfr_erfc(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_218mpfr_erfc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_erfc", 1); + + /* "mpfr.pyx":1943 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1943, __pyx_L1_error) + + /* "mpfr.pyx":1944 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_erfc(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1944, __pyx_L1_error) + + /* "mpfr.pyx":1945 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_erfc(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1945, __pyx_L1_error) + + /* "mpfr.pyx":1946 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_erfc(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_j0(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_erfc((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1937 + * return cmpfr.mpfr_erf(&rop._value, &op._value, rnd) + * + * def mpfr_erfc(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the the complementary error function on op, rounded + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_erfc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1948 + * return cmpfr.mpfr_erfc(&rop._value, &op._value, rnd) + * + * def mpfr_j0(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order 0 on op, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_221mpfr_j0(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_220mpfr_j0, "mpfr_j0(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the first kind Bessel function of order 0 on op,\n rounded in the direction rnd. When op is NaN, rop is always set to\n NaN. When op is plus or minus infinity, rop is set to +0.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_221mpfr_j0 = {"mpfr_j0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_221mpfr_j0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_220mpfr_j0}; +static PyObject *__pyx_pw_4mpfr_221mpfr_j0(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_j0 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1948, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1948, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_j0", 1, 3, 3, 1); __PYX_ERR(1, 1948, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1948, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_j0", 1, 3, 3, 2); __PYX_ERR(1, 1948, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_j0") < 0)) __PYX_ERR(1, 1948, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1948, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_j0", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1948, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_j0", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1948, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1948, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_220mpfr_j0(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_220mpfr_j0(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_j0", 1); + + /* "mpfr.pyx":1955 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1955, __pyx_L1_error) + + /* "mpfr.pyx":1956 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_j0(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1956, __pyx_L1_error) + + /* "mpfr.pyx":1957 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_j0(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1957, __pyx_L1_error) + + /* "mpfr.pyx":1958 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_j0(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_j1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_j0((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1958, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1948 + * return cmpfr.mpfr_erfc(&rop._value, &op._value, rnd) + * + * def mpfr_j0(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order 0 on op, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_j0", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1960 + * return cmpfr.mpfr_j0(&rop._value, &op._value, rnd) + * + * def mpfr_j1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order 1, on op, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_223mpfr_j1(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_222mpfr_j1, "mpfr_j1(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the first kind Bessel function of order 1, on op,\n rounded in the direction rnd. When op is NaN, rop is always set to\n NaN. When op is plus or minus infinity, rop is set to +0. When op is zero,\n rop is set to +0 or \342\210\2220 depending on the sign of op.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_223mpfr_j1 = {"mpfr_j1", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_223mpfr_j1, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_222mpfr_j1}; +static PyObject *__pyx_pw_4mpfr_223mpfr_j1(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_j1 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1960, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1960, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_j1", 1, 3, 3, 1); __PYX_ERR(1, 1960, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1960, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_j1", 1, 3, 3, 2); __PYX_ERR(1, 1960, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_j1") < 0)) __PYX_ERR(1, 1960, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1960, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_j1", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1960, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_j1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1960, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1960, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_222mpfr_j1(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_222mpfr_j1(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_j1", 1); + + /* "mpfr.pyx":1968 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1968, __pyx_L1_error) + + /* "mpfr.pyx":1969 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_j1(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1969, __pyx_L1_error) + + /* "mpfr.pyx":1970 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_j1(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1970, __pyx_L1_error) + + /* "mpfr.pyx":1971 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_j1(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_jn(Mpfr_t rop not None, long int n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_j1((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1971, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1960 + * return cmpfr.mpfr_j0(&rop._value, &op._value, rnd) + * + * def mpfr_j1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order 1, on op, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_j1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1973 + * return cmpfr.mpfr_j1(&rop._value, &op._value, rnd) + * + * def mpfr_jn(Mpfr_t rop not None, long int n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order n on op, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_225mpfr_jn(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_224mpfr_jn, "mpfr_jn(Mpfr_t rop, long n, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the first kind Bessel function of order n on op,\n rounded in the direction rnd. When op is NaN, rop is always set to\n NaN. When op is plus or minus Infinity, rop is set to +0. When op is zero,\n and n is not zero, rop is set to +0 or \342\210\2220 depending on the parity and sign\n of n, and the sign of op.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_225mpfr_jn = {"mpfr_jn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_225mpfr_jn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_224mpfr_jn}; +static PyObject *__pyx_pw_4mpfr_225mpfr_jn(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + long __pyx_v_n; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_jn (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_n,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1973, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1973, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_jn", 1, 4, 4, 1); __PYX_ERR(1, 1973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1973, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_jn", 1, 4, 4, 2); __PYX_ERR(1, 1973, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1973, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_jn", 1, 4, 4, 3); __PYX_ERR(1, 1973, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_jn") < 0)) __PYX_ERR(1, 1973, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_n = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1973, __pyx_L3_error) + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1973, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_jn", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 1973, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_jn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1973, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1973, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_224mpfr_jn(__pyx_self, __pyx_v_rop, __pyx_v_n, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_224mpfr_jn(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, long __pyx_v_n, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_jn", 1); + + /* "mpfr.pyx":1982 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1982, __pyx_L1_error) + + /* "mpfr.pyx":1983 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_jn(&rop._value, n, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1983, __pyx_L1_error) + + /* "mpfr.pyx":1984 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_jn(&rop._value, n, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1984, __pyx_L1_error) + + /* "mpfr.pyx":1985 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_jn(&rop._value, n, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_y0(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_jn((&__pyx_v_rop->_value), __pyx_v_n, (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1973 + * return cmpfr.mpfr_j1(&rop._value, &op._value, rnd) + * + * def mpfr_jn(Mpfr_t rop not None, long int n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order n on op, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_jn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":1987 + * return cmpfr.mpfr_jn(&rop._value, n, &op._value, rnd) + * + * def mpfr_y0(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order 0 on op, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_227mpfr_y0(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_226mpfr_y0, "mpfr_y0(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the second kind Bessel function of order 0 on op,\n rounded in the direction rnd.\n\n When op is NaN or negative, rop is always set to NaN. When op is plus\n infinity, rop is set to +0. When op is zero, rop is set to +0 or -0\n depending on the sign of op.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_227mpfr_y0 = {"mpfr_y0", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_227mpfr_y0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_226mpfr_y0}; +static PyObject *__pyx_pw_4mpfr_227mpfr_y0(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_y0 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1987, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1987, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_y0", 1, 3, 3, 1); __PYX_ERR(1, 1987, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1987, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_y0", 1, 3, 3, 2); __PYX_ERR(1, 1987, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_y0") < 0)) __PYX_ERR(1, 1987, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1987, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_y0", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1987, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_y0", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 1987, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 1987, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_226mpfr_y0(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_226mpfr_y0(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_y0", 1); + + /* "mpfr.pyx":1997 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1997, __pyx_L1_error) + + /* "mpfr.pyx":1998 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_y0(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1998, __pyx_L1_error) + + /* "mpfr.pyx":1999 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_y0(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1999, __pyx_L1_error) + + /* "mpfr.pyx":2000 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_y0(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_y1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_y0((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2000, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":1987 + * return cmpfr.mpfr_jn(&rop._value, n, &op._value, rnd) + * + * def mpfr_y0(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order 0 on op, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_y0", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2002 + * return cmpfr.mpfr_y0(&rop._value, &op._value, rnd) + * + * def mpfr_y1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order 1 on op, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_229mpfr_y1(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_228mpfr_y1, "mpfr_y1(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the second kind Bessel function of order 1 on op,\n rounded in the direction rnd.\n\n When op is NaN or negative, rop is always set to NaN. When op is plus\n infinity, rop is set to +0. When op is zero, rop is set to +0 or -0\n depending on the sign of op.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_229mpfr_y1 = {"mpfr_y1", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_229mpfr_y1, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_228mpfr_y1}; +static PyObject *__pyx_pw_4mpfr_229mpfr_y1(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_y1 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2002, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2002, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_y1", 1, 3, 3, 1); __PYX_ERR(1, 2002, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2002, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_y1", 1, 3, 3, 2); __PYX_ERR(1, 2002, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_y1") < 0)) __PYX_ERR(1, 2002, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2002, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_y1", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2002, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_y1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2002, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2002, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_228mpfr_y1(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_228mpfr_y1(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_y1", 1); + + /* "mpfr.pyx":2012 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2012, __pyx_L1_error) + + /* "mpfr.pyx":2013 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_y1(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2013, __pyx_L1_error) + + /* "mpfr.pyx":2014 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_y1(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2014, __pyx_L1_error) + + /* "mpfr.pyx":2015 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_y1(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_yn(Mpfr_t rop not None, long int n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_y1((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2015, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2002 + * return cmpfr.mpfr_y0(&rop._value, &op._value, rnd) + * + * def mpfr_y1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order 1 on op, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_y1", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2017 + * return cmpfr.mpfr_y1(&rop._value, &op._value, rnd) + * + * def mpfr_yn(Mpfr_t rop not None, long int n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order n on op, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_231mpfr_yn(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_230mpfr_yn, "mpfr_yn(Mpfr_t rop, long n, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the second kind Bessel function of order n on op,\n rounded in the direction rnd. When op is NaN or negative, rop is always set\n to NaN. When op is +Inf, rop is set to +0. When op is zero, rop is set to\n +Inf or \342\210\222Inf depending on the parity and sign of n.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_231mpfr_yn = {"mpfr_yn", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_231mpfr_yn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_230mpfr_yn}; +static PyObject *__pyx_pw_4mpfr_231mpfr_yn(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + long __pyx_v_n; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_yn (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_n,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2017, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_n)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2017, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_yn", 1, 4, 4, 1); __PYX_ERR(1, 2017, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2017, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_yn", 1, 4, 4, 2); __PYX_ERR(1, 2017, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2017, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_yn", 1, 4, 4, 3); __PYX_ERR(1, 2017, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_yn") < 0)) __PYX_ERR(1, 2017, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_n = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 2017, __pyx_L3_error) + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2017, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_yn", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2017, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_yn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2017, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2017, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_230mpfr_yn(__pyx_self, __pyx_v_rop, __pyx_v_n, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_230mpfr_yn(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, long __pyx_v_n, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_yn", 1); + + /* "mpfr.pyx":2025 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2025, __pyx_L1_error) + + /* "mpfr.pyx":2026 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_yn(&rop._value, n, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2026, __pyx_L1_error) + + /* "mpfr.pyx":2027 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_yn(&rop._value, n, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2027, __pyx_L1_error) + + /* "mpfr.pyx":2028 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_yn(&rop._value, n, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_fma(Mpfr_t rop not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_yn((&__pyx_v_rop->_value), __pyx_v_n, (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2017 + * return cmpfr.mpfr_y1(&rop._value, &op._value, rnd) + * + * def mpfr_yn(Mpfr_t rop not None, long int n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order n on op, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_yn", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2030 + * return cmpfr.mpfr_yn(&rop._value, n, &op._value, rnd) + * + * def mpfr_fma(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_233mpfr_fma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_232mpfr_fma, "mpfr_fma(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, Mpfr_t op3, mpfr_rnd_t rnd)\n\n Set rop to (op1 times op2) + op3 rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_233mpfr_fma = {"mpfr_fma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_233mpfr_fma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_232mpfr_fma}; +static PyObject *__pyx_pw_4mpfr_233mpfr_fma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[5] = {0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_fma (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_op3,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2030, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2030, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fma", 1, 5, 5, 1); __PYX_ERR(1, 2030, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2030, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fma", 1, 5, 5, 2); __PYX_ERR(1, 2030, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op3)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2030, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fma", 1, 5, 5, 3); __PYX_ERR(1, 2030, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2030, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fma", 1, 5, 5, 4); __PYX_ERR(1, 2030, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_fma") < 0)) __PYX_ERR(1, 2030, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 5)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_op3 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[3]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[4])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2034, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_fma", 1, 5, 5, __pyx_nargs); __PYX_ERR(1, 2030, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_fma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2030, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 2031, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 2032, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op3), __pyx_ptype_4mpfr_Mpfr_t, 0, "op3", 0))) __PYX_ERR(1, 2033, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_232mpfr_fma(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_op3, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_232mpfr_fma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_fma", 1); + + /* "mpfr.pyx":2039 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2039, __pyx_L1_error) + + /* "mpfr.pyx":2040 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_initialized(op3) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2040, __pyx_L1_error) + + /* "mpfr.pyx":2041 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_initialized(op3) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2041, __pyx_L1_error) + + /* "mpfr.pyx":2042 + * check_initialized(op1) + * check_initialized(op2) + * check_initialized(op3) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fma( + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2042, __pyx_L1_error) + + /* "mpfr.pyx":2043 + * check_initialized(op2) + * check_initialized(op3) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_fma( + * &rop._value, &op1._value, &op2._value, &op3._value, rnd + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2043, __pyx_L1_error) + + /* "mpfr.pyx":2044 + * check_initialized(op3) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fma( # <<<<<<<<<<<<<< + * &rop._value, &op1._value, &op2._value, &op3._value, rnd + * ) + */ + __Pyx_XDECREF(__pyx_r); + + /* "mpfr.pyx":2045 + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fma( + * &rop._value, &op1._value, &op2._value, &op3._value, rnd # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_fma((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), (&__pyx_v_op3->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2030 + * return cmpfr.mpfr_yn(&rop._value, n, &op._value, rnd) + * + * def mpfr_fma(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_fma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2048 + * ) + * + * def mpfr_fms(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_235mpfr_fms(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_234mpfr_fms, "mpfr_fms(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, Mpfr_t op3, mpfr_rnd_t rnd)\n\n Set rop to (op1 times op2) - op3 rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_235mpfr_fms = {"mpfr_fms", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_235mpfr_fms, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_234mpfr_fms}; +static PyObject *__pyx_pw_4mpfr_235mpfr_fms(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[5] = {0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_fms (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_op3,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2048, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2048, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fms", 1, 5, 5, 1); __PYX_ERR(1, 2048, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2048, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fms", 1, 5, 5, 2); __PYX_ERR(1, 2048, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op3)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2048, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fms", 1, 5, 5, 3); __PYX_ERR(1, 2048, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2048, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fms", 1, 5, 5, 4); __PYX_ERR(1, 2048, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_fms") < 0)) __PYX_ERR(1, 2048, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 5)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_op3 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[3]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[4])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2052, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_fms", 1, 5, 5, __pyx_nargs); __PYX_ERR(1, 2048, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_fms", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2048, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 2049, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 2050, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op3), __pyx_ptype_4mpfr_Mpfr_t, 0, "op3", 0))) __PYX_ERR(1, 2051, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_234mpfr_fms(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_op3, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_234mpfr_fms(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_fms", 1); + + /* "mpfr.pyx":2057 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2057, __pyx_L1_error) + + /* "mpfr.pyx":2058 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_initialized(op3) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2058, __pyx_L1_error) + + /* "mpfr.pyx":2059 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_initialized(op3) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2059, __pyx_L1_error) + + /* "mpfr.pyx":2060 + * check_initialized(op1) + * check_initialized(op2) + * check_initialized(op3) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fms( + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2060, __pyx_L1_error) + + /* "mpfr.pyx":2061 + * check_initialized(op2) + * check_initialized(op3) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_fms( + * &rop._value, &op1._value, &op2._value, &op3._value, rnd + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2061, __pyx_L1_error) + + /* "mpfr.pyx":2062 + * check_initialized(op3) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fms( # <<<<<<<<<<<<<< + * &rop._value, &op1._value, &op2._value, &op3._value, rnd + * ) + */ + __Pyx_XDECREF(__pyx_r); + + /* "mpfr.pyx":2063 + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fms( + * &rop._value, &op1._value, &op2._value, &op3._value, rnd # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_fms((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), (&__pyx_v_op3->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2062, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2048 + * ) + * + * def mpfr_fms(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_fms", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2066 + * ) + * + * def mpfr_fmma(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_237mpfr_fmma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_236mpfr_fmma, "mpfr_fmma(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, Mpfr_t op3, Mpfr_t op4, mpfr_rnd_t rnd)\n\n Set rop to (op1 times op2) + (op3 times op4) rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_237mpfr_fmma = {"mpfr_fmma", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_237mpfr_fmma, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_236mpfr_fmma}; +static PyObject *__pyx_pw_4mpfr_237mpfr_fmma(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op4 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[6] = {0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_fmma (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_op3,&__pyx_n_s_op4,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2066, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2066, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmma", 1, 6, 6, 1); __PYX_ERR(1, 2066, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2066, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmma", 1, 6, 6, 2); __PYX_ERR(1, 2066, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op3)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2066, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmma", 1, 6, 6, 3); __PYX_ERR(1, 2066, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op4)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2066, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmma", 1, 6, 6, 4); __PYX_ERR(1, 2066, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2066, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmma", 1, 6, 6, 5); __PYX_ERR(1, 2066, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_fmma") < 0)) __PYX_ERR(1, 2066, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 6)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_op3 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[3]); + __pyx_v_op4 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[4]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[5])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2071, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_fmma", 1, 6, 6, __pyx_nargs); __PYX_ERR(1, 2066, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_fmma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2066, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 2067, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 2068, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op3), __pyx_ptype_4mpfr_Mpfr_t, 0, "op3", 0))) __PYX_ERR(1, 2069, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op4), __pyx_ptype_4mpfr_Mpfr_t, 0, "op4", 0))) __PYX_ERR(1, 2070, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_236mpfr_fmma(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_op3, __pyx_v_op4, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_236mpfr_fmma(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op4, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_fmma", 1); + + /* "mpfr.pyx":2076 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2076, __pyx_L1_error) + + /* "mpfr.pyx":2077 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_initialized(op3) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2077, __pyx_L1_error) + + /* "mpfr.pyx":2078 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_initialized(op3) + * check_initialized(op4) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2078, __pyx_L1_error) + + /* "mpfr.pyx":2079 + * check_initialized(op1) + * check_initialized(op2) + * check_initialized(op3) # <<<<<<<<<<<<<< + * check_initialized(op4) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2079, __pyx_L1_error) + + /* "mpfr.pyx":2080 + * check_initialized(op2) + * check_initialized(op3) + * check_initialized(op4) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fmma( + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2080, __pyx_L1_error) + + /* "mpfr.pyx":2081 + * check_initialized(op3) + * check_initialized(op4) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_fmma( + * &rop._value, &op1._value, &op2._value, &op3._value, &op4._value, rnd + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2081, __pyx_L1_error) + + /* "mpfr.pyx":2082 + * check_initialized(op4) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fmma( # <<<<<<<<<<<<<< + * &rop._value, &op1._value, &op2._value, &op3._value, &op4._value, rnd + * ) + */ + __Pyx_XDECREF(__pyx_r); + + /* "mpfr.pyx":2083 + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fmma( + * &rop._value, &op1._value, &op2._value, &op3._value, &op4._value, rnd # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_fmma((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), (&__pyx_v_op3->_value), (&__pyx_v_op4->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2066 + * ) + * + * def mpfr_fmma(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_fmma", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2086 + * ) + * + * def mpfr_fmms(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_239mpfr_fmms(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_238mpfr_fmms, "mpfr_fmms(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, Mpfr_t op3, Mpfr_t op4, mpfr_rnd_t rnd)\n\n Set rop to (op1 times op2) - (op3 times op4) rounded in the direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_239mpfr_fmms = {"mpfr_fmms", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_239mpfr_fmms, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_238mpfr_fmms}; +static PyObject *__pyx_pw_4mpfr_239mpfr_fmms(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op4 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[6] = {0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_fmms (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_op3,&__pyx_n_s_op4,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2086, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2086, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmms", 1, 6, 6, 1); __PYX_ERR(1, 2086, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2086, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmms", 1, 6, 6, 2); __PYX_ERR(1, 2086, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op3)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2086, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmms", 1, 6, 6, 3); __PYX_ERR(1, 2086, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op4)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2086, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmms", 1, 6, 6, 4); __PYX_ERR(1, 2086, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2086, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmms", 1, 6, 6, 5); __PYX_ERR(1, 2086, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_fmms") < 0)) __PYX_ERR(1, 2086, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 6)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_op3 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[3]); + __pyx_v_op4 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[4]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[5])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2091, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_fmms", 1, 6, 6, __pyx_nargs); __PYX_ERR(1, 2086, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_fmms", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2086, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 2087, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 2088, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op3), __pyx_ptype_4mpfr_Mpfr_t, 0, "op3", 0))) __PYX_ERR(1, 2089, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op4), __pyx_ptype_4mpfr_Mpfr_t, 0, "op4", 0))) __PYX_ERR(1, 2090, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_238mpfr_fmms(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_op3, __pyx_v_op4, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_238mpfr_fmms(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op3, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op4, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_fmms", 1); + + /* "mpfr.pyx":2096 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2096, __pyx_L1_error) + + /* "mpfr.pyx":2097 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_initialized(op3) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2097, __pyx_L1_error) + + /* "mpfr.pyx":2098 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_initialized(op3) + * check_initialized(op4) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2098, __pyx_L1_error) + + /* "mpfr.pyx":2099 + * check_initialized(op1) + * check_initialized(op2) + * check_initialized(op3) # <<<<<<<<<<<<<< + * check_initialized(op4) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2099, __pyx_L1_error) + + /* "mpfr.pyx":2100 + * check_initialized(op2) + * check_initialized(op3) + * check_initialized(op4) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fmms( + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2100, __pyx_L1_error) + + /* "mpfr.pyx":2101 + * check_initialized(op3) + * check_initialized(op4) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_fmms( + * &rop._value, &op1._value, &op2._value, &op3._value, &op4._value, rnd + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2101, __pyx_L1_error) + + /* "mpfr.pyx":2102 + * check_initialized(op4) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fmms( # <<<<<<<<<<<<<< + * &rop._value, &op1._value, &op2._value, &op3._value, &op4._value, rnd + * ) + */ + __Pyx_XDECREF(__pyx_r); + + /* "mpfr.pyx":2103 + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fmms( + * &rop._value, &op1._value, &op2._value, &op3._value, &op4._value, rnd # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_fmms((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), (&__pyx_v_op3->_value), (&__pyx_v_op4->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2086 + * ) + * + * def mpfr_fmms(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_fmms", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2106 + * ) + * + * def mpfr_agm(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_241mpfr_agm(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_240mpfr_agm, "mpfr_agm(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to the arithmetic-geometric mean of op1 and op2, rounded in the\n direction rnd. The arithmetic-geometric mean is the common limit of the\n sequences u_n and v_n, where u_0=op1, v_0=op2, u_(n+1) is the arithmetic\n mean of u_n and v_n, and v_(n+1) is the geometric mean of u_n and v_n. If\n any operand is negative, set rop to NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_241mpfr_agm = {"mpfr_agm", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_241mpfr_agm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_240mpfr_agm}; +static PyObject *__pyx_pw_4mpfr_241mpfr_agm(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_agm (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2106, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2106, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_agm", 1, 4, 4, 1); __PYX_ERR(1, 2106, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2106, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_agm", 1, 4, 4, 2); __PYX_ERR(1, 2106, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2106, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_agm", 1, 4, 4, 3); __PYX_ERR(1, 2106, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_agm") < 0)) __PYX_ERR(1, 2106, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2109, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_agm", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2106, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_agm", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2106, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 2107, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 2108, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_240mpfr_agm(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_240mpfr_agm(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_agm", 1); + + /* "mpfr.pyx":2118 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2118, __pyx_L1_error) + + /* "mpfr.pyx":2119 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2119, __pyx_L1_error) + + /* "mpfr.pyx":2120 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_agm(&rop._value, &op1._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2120, __pyx_L1_error) + + /* "mpfr.pyx":2121 + * check_initialized(op1) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_agm(&rop._value, &op1._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2121, __pyx_L1_error) + + /* "mpfr.pyx":2122 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_agm(&rop._value, &op1._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_hypot(Mpfr_t rop not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_agm((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2106 + * ) + * + * def mpfr_agm(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_agm", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2124 + * return cmpfr.mpfr_agm(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_hypot(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t x not None, + * Mpfr_t y not None, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_243mpfr_hypot(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_242mpfr_hypot, "mpfr_hypot(Mpfr_t rop, Mpfr_t x, Mpfr_t y, mpfr_rnd_t rnd)\n\n Set rop to the Euclidean norm of x and y, i.e., the square root of the sum\n of the squares of x and y, rounded in the direction rnd. Special values are\n handled as described in Section F.9.4.3 of the ISO C99 and IEEE 754-2008\n standards: If x or y is an infinity, then +Inf is returned in rop, even if\n the other number is NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_243mpfr_hypot = {"mpfr_hypot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_243mpfr_hypot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_242mpfr_hypot}; +static PyObject *__pyx_pw_4mpfr_243mpfr_hypot(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_hypot (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2124, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2124, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_hypot", 1, 4, 4, 1); __PYX_ERR(1, 2124, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2124, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_hypot", 1, 4, 4, 2); __PYX_ERR(1, 2124, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2124, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_hypot", 1, 4, 4, 3); __PYX_ERR(1, 2124, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_hypot") < 0)) __PYX_ERR(1, 2124, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_y = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2127, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_hypot", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2124, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_hypot", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2124, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 2125, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4mpfr_Mpfr_t, 0, "y", 0))) __PYX_ERR(1, 2126, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_242mpfr_hypot(__pyx_self, __pyx_v_rop, __pyx_v_x, __pyx_v_y, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_242mpfr_hypot(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_hypot", 1); + + /* "mpfr.pyx":2136 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(x) + * check_initialized(y) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2136, __pyx_L1_error) + + /* "mpfr.pyx":2137 + * """ + * check_initialized(rop) + * check_initialized(x) # <<<<<<<<<<<<<< + * check_initialized(y) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2137, __pyx_L1_error) + + /* "mpfr.pyx":2138 + * check_initialized(rop) + * check_initialized(x) + * check_initialized(y) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_hypot(&rop._value, &x._value, &y._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_y); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2138, __pyx_L1_error) + + /* "mpfr.pyx":2139 + * check_initialized(x) + * check_initialized(y) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_hypot(&rop._value, &x._value, &y._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2139, __pyx_L1_error) + + /* "mpfr.pyx":2140 + * check_initialized(y) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_hypot(&rop._value, &x._value, &y._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_ai(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_hypot((&__pyx_v_rop->_value), (&__pyx_v_x->_value), (&__pyx_v_y->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2140, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2124 + * return cmpfr.mpfr_agm(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_hypot(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t x not None, + * Mpfr_t y not None, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_hypot", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2142 + * return cmpfr.mpfr_hypot(&rop._value, &x._value, &y._value, rnd) + * + * def mpfr_ai(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Airy function Ai on x, rounded in the direction + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_245mpfr_ai(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_244mpfr_ai, "mpfr_ai(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the value of the Airy function Ai on x, rounded in the direction\n rnd.\n\n When x is NaN, rop is always set to NaN. When x is +Inf or \342\210\222Inf, rop\n is +0. The current implementation is not intended to be used with large\n arguments. It works with abs(x) typically smaller than 500. For larger\n arguments, other methods should be used and will be implemented in a future\n version.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_245mpfr_ai = {"mpfr_ai", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_245mpfr_ai, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_244mpfr_ai}; +static PyObject *__pyx_pw_4mpfr_245mpfr_ai(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_ai (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2142, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2142, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_ai", 1, 3, 3, 1); __PYX_ERR(1, 2142, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2142, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_ai", 1, 3, 3, 2); __PYX_ERR(1, 2142, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_ai") < 0)) __PYX_ERR(1, 2142, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2142, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_ai", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2142, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_ai", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2142, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2142, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_244mpfr_ai(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_244mpfr_ai(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_ai", 1); + + /* "mpfr.pyx":2154 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2154, __pyx_L1_error) + + /* "mpfr.pyx":2155 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_ai(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2155, __pyx_L1_error) + + /* "mpfr.pyx":2156 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_ai(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2156, __pyx_L1_error) + + /* "mpfr.pyx":2157 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_ai(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_const_log2(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_ai((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2142 + * return cmpfr.mpfr_hypot(&rop._value, &x._value, &y._value, rnd) + * + * def mpfr_ai(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Airy function Ai on x, rounded in the direction + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_ai", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2159 + * return cmpfr.mpfr_ai(&rop._value, &op._value, rnd) + * + * def mpfr_const_log2(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to log(2), rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_247mpfr_const_log2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_246mpfr_const_log2, "mpfr_const_log2(Mpfr_t rop, mpfr_rnd_t rnd)\n\n Set rop to log(2), rounded in the direction rnd.\n\n Set rop to the natural logarithm of 2, rounded in the direction rnd. This\n function caches the computed values to avoid other calculations if a lower\n or equal precision is requested. To free this cache, use mpfr_free_cache.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_247mpfr_const_log2 = {"mpfr_const_log2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_247mpfr_const_log2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_246mpfr_const_log2}; +static PyObject *__pyx_pw_4mpfr_247mpfr_const_log2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_const_log2 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2159, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2159, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_const_log2", 1, 2, 2, 1); __PYX_ERR(1, 2159, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_const_log2") < 0)) __PYX_ERR(1, 2159, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2159, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_const_log2", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2159, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_const_log2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2159, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_246mpfr_const_log2(__pyx_self, __pyx_v_rop, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_246mpfr_const_log2(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_const_log2", 1); + + /* "mpfr.pyx":2168 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_const_log2(&rop._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2168, __pyx_L1_error) + + /* "mpfr.pyx":2169 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_const_log2(&rop._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2169, __pyx_L1_error) + + /* "mpfr.pyx":2170 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_const_log2(&rop._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_const_pi(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_const_log2((&__pyx_v_rop->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2159 + * return cmpfr.mpfr_ai(&rop._value, &op._value, rnd) + * + * def mpfr_const_log2(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to log(2), rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_const_log2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2172 + * return cmpfr.mpfr_const_log2(&rop._value, rnd) + * + * def mpfr_const_pi(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Pi, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_249mpfr_const_pi(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_248mpfr_const_pi, "mpfr_const_pi(Mpfr_t rop, mpfr_rnd_t rnd)\n\n Set rop to Pi, rounded in the direction rnd.\n\n Set rop to the value of Pi, rounded in the direction rnd. This function\n caches the computed value to avoid other calculations if a lower or equal\n precision is requested. To free this cache, use mpfr_free_cache.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_249mpfr_const_pi = {"mpfr_const_pi", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_249mpfr_const_pi, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_248mpfr_const_pi}; +static PyObject *__pyx_pw_4mpfr_249mpfr_const_pi(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_const_pi (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2172, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2172, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_const_pi", 1, 2, 2, 1); __PYX_ERR(1, 2172, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_const_pi") < 0)) __PYX_ERR(1, 2172, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2172, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_const_pi", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2172, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_const_pi", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2172, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_248mpfr_const_pi(__pyx_self, __pyx_v_rop, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_248mpfr_const_pi(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_const_pi", 1); + + /* "mpfr.pyx":2181 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_const_pi(&rop._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2181, __pyx_L1_error) + + /* "mpfr.pyx":2182 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_const_pi(&rop._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2182, __pyx_L1_error) + + /* "mpfr.pyx":2183 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_const_pi(&rop._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_const_euler(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_const_pi((&__pyx_v_rop->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2183, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2172 + * return cmpfr.mpfr_const_log2(&rop._value, rnd) + * + * def mpfr_const_pi(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Pi, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_const_pi", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2185 + * return cmpfr.mpfr_const_pi(&rop._value, rnd) + * + * def mpfr_const_euler(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Euler's constant, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_251mpfr_const_euler(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_250mpfr_const_euler, "mpfr_const_euler(Mpfr_t rop, mpfr_rnd_t rnd)\n\n Set rop to Euler's constant, rounded in the direction rnd.\n\n Set rop to the value of Euler's constant 0.577..., rounded in the direction\n rnd. This function caches the computed value to avoid other calculations\n if a lower or equal precision is requested. To free this cache, use\n mpfr_free_cache.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_251mpfr_const_euler = {"mpfr_const_euler", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_251mpfr_const_euler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_250mpfr_const_euler}; +static PyObject *__pyx_pw_4mpfr_251mpfr_const_euler(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_const_euler (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2185, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2185, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_const_euler", 1, 2, 2, 1); __PYX_ERR(1, 2185, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_const_euler") < 0)) __PYX_ERR(1, 2185, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2185, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_const_euler", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2185, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_const_euler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2185, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_250mpfr_const_euler(__pyx_self, __pyx_v_rop, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_250mpfr_const_euler(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_const_euler", 1); + + /* "mpfr.pyx":2195 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_const_euler(&rop._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2195, __pyx_L1_error) + + /* "mpfr.pyx":2196 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_const_euler(&rop._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2196, __pyx_L1_error) + + /* "mpfr.pyx":2197 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_const_euler(&rop._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_const_catalan(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_const_euler((&__pyx_v_rop->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2185 + * return cmpfr.mpfr_const_pi(&rop._value, rnd) + * + * def mpfr_const_euler(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Euler's constant, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_const_euler", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2199 + * return cmpfr.mpfr_const_euler(&rop._value, rnd) + * + * def mpfr_const_catalan(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Catalan's constant, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_253mpfr_const_catalan(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_252mpfr_const_catalan, "mpfr_const_catalan(Mpfr_t rop, mpfr_rnd_t rnd)\n\n Set rop to Catalan's constant, rounded in the direction rnd.\n\n Set rop to the value of Catalan's constant 0.915..., rounded in the\n direction rnd. This function caches the computed value to avoid other\n calculations if a lower or equal precision is requested. To free this\n cache, use mpfr_free_cache.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_253mpfr_const_catalan = {"mpfr_const_catalan", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_253mpfr_const_catalan, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_252mpfr_const_catalan}; +static PyObject *__pyx_pw_4mpfr_253mpfr_const_catalan(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_const_catalan (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2199, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2199, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_const_catalan", 1, 2, 2, 1); __PYX_ERR(1, 2199, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_const_catalan") < 0)) __PYX_ERR(1, 2199, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[1])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2199, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_const_catalan", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2199, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_const_catalan", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2199, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_252mpfr_const_catalan(__pyx_self, __pyx_v_rop, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_252mpfr_const_catalan(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_const_catalan", 1); + + /* "mpfr.pyx":2209 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_const_catalan(&rop._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2209, __pyx_L1_error) + + /* "mpfr.pyx":2210 + * """ + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_const_catalan(&rop._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2210, __pyx_L1_error) + + /* "mpfr.pyx":2211 + * check_initialized(rop) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_const_catalan(&rop._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_free_cache(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_const_catalan((&__pyx_v_rop->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2199 + * return cmpfr.mpfr_const_euler(&rop._value, rnd) + * + * def mpfr_const_catalan(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Catalan's constant, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_const_catalan", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2213 + * return cmpfr.mpfr_const_catalan(&rop._value, rnd) + * + * def mpfr_free_cache(): # <<<<<<<<<<<<<< + * """ + * Free internal MPFR caches. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_255mpfr_free_cache(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_254mpfr_free_cache, "mpfr_free_cache()\n\n Free internal MPFR caches.\n\n Free various caches used by MPFR internally, in particular the caches\n used by the functions computing constants (mpfr_const_log2, mpfr_const_pi,\n mpfr_const_euler and mpfr_const_catalan). You should call this function\n before terminating a thread, even if you did not call these functions\n directly (they could have been called internally).\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_255mpfr_free_cache = {"mpfr_free_cache", (PyCFunction)__pyx_pw_4mpfr_255mpfr_free_cache, METH_NOARGS, __pyx_doc_4mpfr_254mpfr_free_cache}; +static PyObject *__pyx_pw_4mpfr_255mpfr_free_cache(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_free_cache (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_254mpfr_free_cache(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_254mpfr_free_cache(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_free_cache", 1); + + /* "mpfr.pyx":2224 + * + * """ + * cmpfr.mpfr_free_cache() # <<<<<<<<<<<<<< + * + * def mpfr_free_cache2(cmpfr.mpfr_free_cache_t way): + */ + mpfr_free_cache(); + + /* "mpfr.pyx":2213 + * return cmpfr.mpfr_const_catalan(&rop._value, rnd) + * + * def mpfr_free_cache(): # <<<<<<<<<<<<<< + * """ + * Free internal MPFR caches. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2226 + * cmpfr.mpfr_free_cache() + * + * def mpfr_free_cache2(cmpfr.mpfr_free_cache_t way): # <<<<<<<<<<<<<< + * """ + * Free various caches and pools used by MPFR internally, as specified by + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_257mpfr_free_cache2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_256mpfr_free_cache2, "mpfr_free_cache2(mpfr_free_cache_t way)\n\n Free various caches and pools used by MPFR internally, as specified by\n 'way', which is a set of flags.\n\n - those local to the current thread if MPFR_FREE_LOCAL_CACHE is set\n - those shared by all threads if MPFR_FREE_GLOBAL_CACHE is set.\n\n Note: mpfr_free_cache2(MPFR_FREE_LOCAL_CACHE|MPFR_FREE_GLOBAL_CACHE)\n is currently equivalent to mpfr_free_cache().\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_257mpfr_free_cache2 = {"mpfr_free_cache2", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_257mpfr_free_cache2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_256mpfr_free_cache2}; +static PyObject *__pyx_pw_4mpfr_257mpfr_free_cache2(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + mpfr_free_cache_t __pyx_v_way; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_free_cache2 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_way,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_way)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2226, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_free_cache2") < 0)) __PYX_ERR(1, 2226, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_way = ((mpfr_free_cache_t)__Pyx_PyInt_As_mpfr_free_cache_t(values[0])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2226, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_free_cache2", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 2226, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_free_cache2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_256mpfr_free_cache2(__pyx_self, __pyx_v_way); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_256mpfr_free_cache2(CYTHON_UNUSED PyObject *__pyx_self, mpfr_free_cache_t __pyx_v_way) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_free_cache2", 1); + + /* "mpfr.pyx":2238 + * + * """ + * check_cache_flags(way) # <<<<<<<<<<<<<< + * cmpfr.mpfr_free_cache2(way) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_cache_flags(__pyx_v_way); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2238, __pyx_L1_error) + + /* "mpfr.pyx":2239 + * """ + * check_cache_flags(way) + * cmpfr.mpfr_free_cache2(way) # <<<<<<<<<<<<<< + * + * def mpfr_free_pool(): + */ + mpfr_free_cache2(__pyx_v_way); + + /* "mpfr.pyx":2226 + * cmpfr.mpfr_free_cache() + * + * def mpfr_free_cache2(cmpfr.mpfr_free_cache_t way): # <<<<<<<<<<<<<< + * """ + * Free various caches and pools used by MPFR internally, as specified by + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_free_cache2", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2241 + * cmpfr.mpfr_free_cache2(way) + * + * def mpfr_free_pool(): # <<<<<<<<<<<<<< + * + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_259mpfr_free_pool(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_258mpfr_free_pool, "mpfr_free_pool()\n\n Free the pools used by MPFR internally. The pools are automatically\n freed after the thread-local caches are freed (via mpfr_free_cache).\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_259mpfr_free_pool = {"mpfr_free_pool", (PyCFunction)__pyx_pw_4mpfr_259mpfr_free_pool, METH_NOARGS, __pyx_doc_4mpfr_258mpfr_free_pool}; +static PyObject *__pyx_pw_4mpfr_259mpfr_free_pool(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_free_pool (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_258mpfr_free_pool(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_258mpfr_free_pool(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_free_pool", 1); + + /* "mpfr.pyx":2248 + * + * """ + * cmpfr.mpfr_free_pool() # <<<<<<<<<<<<<< + * + * def mpfr_mp_memory_cleanup(): + */ + mpfr_free_pool(); + + /* "mpfr.pyx":2241 + * cmpfr.mpfr_free_cache2(way) + * + * def mpfr_free_pool(): # <<<<<<<<<<<<<< + * + * """ + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2250 + * cmpfr.mpfr_free_pool() + * + * def mpfr_mp_memory_cleanup(): # <<<<<<<<<<<<<< + * """ + * This function should be called before calling mp_set_memory_functions. See + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_261mpfr_mp_memory_cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_260mpfr_mp_memory_cleanup, "mpfr_mp_memory_cleanup()\n\n This function should be called before calling mp_set_memory_functions. See\n the MPFR documentation on Memory Handling for more information. MemoryError\n is raised in case of error. Errors are currently not possible, but checking\n the return value is recommended for future compatibility.\n "); +static PyMethodDef __pyx_mdef_4mpfr_261mpfr_mp_memory_cleanup = {"mpfr_mp_memory_cleanup", (PyCFunction)__pyx_pw_4mpfr_261mpfr_mp_memory_cleanup, METH_NOARGS, __pyx_doc_4mpfr_260mpfr_mp_memory_cleanup}; +static PyObject *__pyx_pw_4mpfr_261mpfr_mp_memory_cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_mp_memory_cleanup (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_260mpfr_mp_memory_cleanup(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_260mpfr_mp_memory_cleanup(CYTHON_UNUSED PyObject *__pyx_self) { + int __pyx_v_rc; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_mp_memory_cleanup", 1); + + /* "mpfr.pyx":2258 + * """ + * cdef int rc + * rc = cmpfr.mpfr_mp_memory_cleanup() # <<<<<<<<<<<<<< + * if rc: + * raise MemoryError( + */ + __pyx_v_rc = mpfr_mp_memory_cleanup(); + + /* "mpfr.pyx":2259 + * cdef int rc + * rc = cmpfr.mpfr_mp_memory_cleanup() + * if rc: # <<<<<<<<<<<<<< + * raise MemoryError( + * "mpfr_mp_memory_cleanup returned nonzero value {}".format(rc)) + */ + __pyx_t_1 = (__pyx_v_rc != 0); + if (unlikely(__pyx_t_1)) { + + /* "mpfr.pyx":2261 + * if rc: + * raise MemoryError( + * "mpfr_mp_memory_cleanup returned nonzero value {}".format(rc)) # <<<<<<<<<<<<<< + * + * def mpfr_sum(Mpfr_t rop not None, tab, cmpfr.mpfr_rnd_t rnd): + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_mpfr_mp_memory_cleanup_returned, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2261, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + + /* "mpfr.pyx":2260 + * rc = cmpfr.mpfr_mp_memory_cleanup() + * if rc: + * raise MemoryError( # <<<<<<<<<<<<<< + * "mpfr_mp_memory_cleanup returned nonzero value {}".format(rc)) + * + */ + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2260, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 2260, __pyx_L1_error) + + /* "mpfr.pyx":2259 + * cdef int rc + * rc = cmpfr.mpfr_mp_memory_cleanup() + * if rc: # <<<<<<<<<<<<<< + * raise MemoryError( + * "mpfr_mp_memory_cleanup returned nonzero value {}".format(rc)) + */ + } + + /* "mpfr.pyx":2250 + * cmpfr.mpfr_free_pool() + * + * def mpfr_mp_memory_cleanup(): # <<<<<<<<<<<<<< + * """ + * This function should be called before calling mp_set_memory_functions. See + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("mpfr.mpfr_mp_memory_cleanup", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2263 + * "mpfr_mp_memory_cleanup returned nonzero value {}".format(rc)) + * + * def mpfr_sum(Mpfr_t rop not None, tab, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the sum of the elements of tab, rounded in the direction rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_263mpfr_sum(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_262mpfr_sum, "mpfr_sum(Mpfr_t rop, tab, mpfr_rnd_t rnd)\n\n Set rop to the sum of the elements of tab, rounded in the direction rnd.\n\n Set rop to the sum of all elements of tab, correctly rounded in the\n direction rnd. If tab is empty, then the result is +0, and if tab contains\n a single element, then the function is equivalent to mpfr_set. For the\n special exact cases, the result is the same as the one obtained with a\n succession of additions (mpfr_add) in infinite precision. In particular, if\n the result is an exact zero and tab is not empty:\n\n - if all the inputs have the same sign (i.e., all +0 or all -0), then the\n result has the same sign as the inputs;\n\n - otherwise, either because all inputs are zeros with at least a +0 and a\n -0, or because some inputs are non-zero (but they globally cancel), the\n result is +0, except for the MPFR_RNDD rounding mode, where it is -0.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_263mpfr_sum = {"mpfr_sum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_263mpfr_sum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_262mpfr_sum}; +static PyObject *__pyx_pw_4mpfr_263mpfr_sum(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + PyObject *__pyx_v_tab = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_sum (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_tab,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2263, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_tab)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2263, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sum", 1, 3, 3, 1); __PYX_ERR(1, 2263, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2263, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_sum", 1, 3, 3, 2); __PYX_ERR(1, 2263, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_sum") < 0)) __PYX_ERR(1, 2263, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_tab = values[1]; + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2263, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_sum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2263, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_sum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2263, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_262mpfr_sum(__pyx_self, __pyx_v_rop, __pyx_v_tab, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_262mpfr_sum(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, PyObject *__pyx_v_tab, mpfr_rnd_t __pyx_v_rnd) { + unsigned int __pyx_v_i; + unsigned int __pyx_v_n; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_elt = 0; + mpfr_ptr *__pyx_v_pointers; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + Py_ssize_t __pyx_t_2; + int __pyx_t_3; + unsigned int __pyx_t_4; + unsigned int __pyx_t_5; + unsigned int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + char const *__pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_sum", 1); + + /* "mpfr.pyx":2285 + * cdef Mpfr_t elt + * + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2285, __pyx_L1_error) + + /* "mpfr.pyx":2286 + * + * check_initialized(rop) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * + * n = len(tab) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2286, __pyx_L1_error) + + /* "mpfr.pyx":2288 + * check_rounding_mode(rnd) + * + * n = len(tab) # <<<<<<<<<<<<<< + * + * cdef cmpfr.mpfr_ptr *pointers = libc.stdlib.malloc( + */ + __pyx_t_2 = PyObject_Length(__pyx_v_tab); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 2288, __pyx_L1_error) + __pyx_v_n = __pyx_t_2; + + /* "mpfr.pyx":2290 + * n = len(tab) + * + * cdef cmpfr.mpfr_ptr *pointers = libc.stdlib.malloc( # <<<<<<<<<<<<<< + * n * sizeof(cmpfr.mpfr_ptr)) + * if not pointers: + */ + __pyx_v_pointers = ((mpfr_ptr *)malloc((__pyx_v_n * (sizeof(mpfr_ptr))))); + + /* "mpfr.pyx":2292 + * cdef cmpfr.mpfr_ptr *pointers = libc.stdlib.malloc( + * n * sizeof(cmpfr.mpfr_ptr)) + * if not pointers: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + __pyx_t_3 = (!(__pyx_v_pointers != 0)); + if (unlikely(__pyx_t_3)) { + + /* "mpfr.pyx":2293 + * n * sizeof(cmpfr.mpfr_ptr)) + * if not pointers: + * raise MemoryError # <<<<<<<<<<<<<< + * + * try: + */ + PyErr_NoMemory(); __PYX_ERR(1, 2293, __pyx_L1_error) + + /* "mpfr.pyx":2292 + * cdef cmpfr.mpfr_ptr *pointers = libc.stdlib.malloc( + * n * sizeof(cmpfr.mpfr_ptr)) + * if not pointers: # <<<<<<<<<<<<<< + * raise MemoryError + * + */ + } + + /* "mpfr.pyx":2295 + * raise MemoryError + * + * try: # <<<<<<<<<<<<<< + * for i in range(n): + * elt = tab[i] + */ + /*try:*/ { + + /* "mpfr.pyx":2296 + * + * try: + * for i in range(n): # <<<<<<<<<<<<<< + * elt = tab[i] + * if elt is None: + */ + __pyx_t_4 = __pyx_v_n; + __pyx_t_5 = __pyx_t_4; + for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { + __pyx_v_i = __pyx_t_6; + + /* "mpfr.pyx":2297 + * try: + * for i in range(n): + * elt = tab[i] # <<<<<<<<<<<<<< + * if elt is None: + * raise TypeError("Cannot convert None to mpfr.Mpfr_t") + */ + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_tab, __pyx_v_i, unsigned int, 0, __Pyx_PyInt_From_unsigned_int, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2297, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_7); + if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_4mpfr_Mpfr_t))))) __PYX_ERR(1, 2297, __pyx_L5_error) + __Pyx_XDECREF_SET(__pyx_v_elt, ((struct __pyx_obj_4mpfr_Mpfr_t *)__pyx_t_7)); + __pyx_t_7 = 0; + + /* "mpfr.pyx":2298 + * for i in range(n): + * elt = tab[i] + * if elt is None: # <<<<<<<<<<<<<< + * raise TypeError("Cannot convert None to mpfr.Mpfr_t") + * check_initialized(elt) + */ + __pyx_t_3 = (((PyObject *)__pyx_v_elt) == Py_None); + if (unlikely(__pyx_t_3)) { + + /* "mpfr.pyx":2299 + * elt = tab[i] + * if elt is None: + * raise TypeError("Cannot convert None to mpfr.Mpfr_t") # <<<<<<<<<<<<<< + * check_initialized(elt) + * pointers[i] = &elt._value + */ + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2299, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_Raise(__pyx_t_7, 0, 0, 0); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __PYX_ERR(1, 2299, __pyx_L5_error) + + /* "mpfr.pyx":2298 + * for i in range(n): + * elt = tab[i] + * if elt is None: # <<<<<<<<<<<<<< + * raise TypeError("Cannot convert None to mpfr.Mpfr_t") + * check_initialized(elt) + */ + } + + /* "mpfr.pyx":2300 + * if elt is None: + * raise TypeError("Cannot convert None to mpfr.Mpfr_t") + * check_initialized(elt) # <<<<<<<<<<<<<< + * pointers[i] = &elt._value + * return cmpfr.mpfr_sum(&rop._value, pointers, n, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_elt); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2300, __pyx_L5_error) + + /* "mpfr.pyx":2301 + * raise TypeError("Cannot convert None to mpfr.Mpfr_t") + * check_initialized(elt) + * pointers[i] = &elt._value # <<<<<<<<<<<<<< + * return cmpfr.mpfr_sum(&rop._value, pointers, n, rnd) + * finally: + */ + (__pyx_v_pointers[__pyx_v_i]) = (&__pyx_v_elt->_value); + } + + /* "mpfr.pyx":2302 + * check_initialized(elt) + * pointers[i] = &elt._value + * return cmpfr.mpfr_sum(&rop._value, pointers, n, rnd) # <<<<<<<<<<<<<< + * finally: + * libc.stdlib.free(pointers) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = __Pyx_PyInt_From_int(mpfr_sum((&__pyx_v_rop->_value), __pyx_v_pointers, __pyx_v_n, __pyx_v_rnd)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 2302, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L4_return; + } + + /* "mpfr.pyx":2304 + * return cmpfr.mpfr_sum(&rop._value, pointers, n, rnd) + * finally: + * libc.stdlib.free(pointers) # <<<<<<<<<<<<<< + * + * ########################################################################### + */ + /*finally:*/ { + __pyx_L5_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __Pyx_XGOTREF(__pyx_t_15); + __pyx_t_1 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename; + { + free(__pyx_v_pointers); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_XGIVEREF(__pyx_t_15); + __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); + } + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12); + __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; + __pyx_lineno = __pyx_t_1; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9; + goto __pyx_L1_error; + } + __pyx_L4_return: { + __pyx_t_15 = __pyx_r; + __pyx_r = 0; + free(__pyx_v_pointers); + __pyx_r = __pyx_t_15; + __pyx_t_15 = 0; + goto __pyx_L0; + } + } + + /* "mpfr.pyx":2263 + * "mpfr_mp_memory_cleanup returned nonzero value {}".format(rc)) + * + * def mpfr_sum(Mpfr_t rop not None, tab, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the sum of the elements of tab, rounded in the direction rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("mpfr.mpfr_sum", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF((PyObject *)__pyx_v_elt); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2310 + * ########################################################################### + * + * def mpfr_asprintf(object template, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Compute a string representation of 'op' based on the given template. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_265mpfr_asprintf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_264mpfr_asprintf, "mpfr_asprintf(template, Mpfr_t op)\n\n Compute a string representation of 'op' based on the given template.\n\n This is a restricted version of the function offered by the MPFR library.\n It supports formatting of a single argument of type Mpfr_t. The template\n should have only a single conversion specifier.\n\n See the MPFR documentation for full details of the conversion specifier\n format.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_265mpfr_asprintf = {"mpfr_asprintf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_265mpfr_asprintf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_264mpfr_asprintf}; +static PyObject *__pyx_pw_4mpfr_265mpfr_asprintf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_template = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_asprintf (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_template,&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_template)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2310, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2310, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_asprintf", 1, 2, 2, 1); __PYX_ERR(1, 2310, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_asprintf") < 0)) __PYX_ERR(1, 2310, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_template = values[0]; + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_asprintf", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2310, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_asprintf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2310, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_264mpfr_asprintf(__pyx_self, __pyx_v_template, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_264mpfr_asprintf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_template, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + char *__pyx_v_output; + PyObject *__pyx_v_template_bytes = 0; + int __pyx_v_rv; + PyObject *__pyx_v_output_as_bytes = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + char const *__pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + char const *__pyx_t_8; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + PyObject *__pyx_t_13 = NULL; + PyObject *__pyx_t_14 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_asprintf", 1); + + /* "mpfr.pyx":2323 + * """ + * cdef char *output + * cdef bytes template_bytes = template.encode('ascii') # <<<<<<<<<<<<<< + * rv = cmpfr.mpfr_asprintf(&output, template_bytes, &op._value) + * if rv < 0: + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_template, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_n_u_ascii}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2323, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(1, 2323, __pyx_L1_error) + __pyx_v_template_bytes = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "mpfr.pyx":2324 + * cdef char *output + * cdef bytes template_bytes = template.encode('ascii') + * rv = cmpfr.mpfr_asprintf(&output, template_bytes, &op._value) # <<<<<<<<<<<<<< + * if rv < 0: + * raise RuntimeError("Error during string conversion.") + */ + if (unlikely(__pyx_v_template_bytes == Py_None)) { + PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); + __PYX_ERR(1, 2324, __pyx_L1_error) + } + __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_template_bytes); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(1, 2324, __pyx_L1_error) + __pyx_v_rv = mpfr_asprintf((&__pyx_v_output), __pyx_t_5, (&__pyx_v_op->_value)); + + /* "mpfr.pyx":2325 + * cdef bytes template_bytes = template.encode('ascii') + * rv = cmpfr.mpfr_asprintf(&output, template_bytes, &op._value) + * if rv < 0: # <<<<<<<<<<<<<< + * raise RuntimeError("Error during string conversion.") + * + */ + __pyx_t_6 = (__pyx_v_rv < 0); + if (unlikely(__pyx_t_6)) { + + /* "mpfr.pyx":2326 + * rv = cmpfr.mpfr_asprintf(&output, template_bytes, &op._value) + * if rv < 0: + * raise RuntimeError("Error during string conversion.") # <<<<<<<<<<<<<< + * + * try: + */ + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2326, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(1, 2326, __pyx_L1_error) + + /* "mpfr.pyx":2325 + * cdef bytes template_bytes = template.encode('ascii') + * rv = cmpfr.mpfr_asprintf(&output, template_bytes, &op._value) + * if rv < 0: # <<<<<<<<<<<<<< + * raise RuntimeError("Error during string conversion.") + * + */ + } + + /* "mpfr.pyx":2328 + * raise RuntimeError("Error during string conversion.") + * + * try: # <<<<<<<<<<<<<< + * output_as_bytes = bytes(output) + * finally: + */ + /*try:*/ { + + /* "mpfr.pyx":2329 + * + * try: + * output_as_bytes = bytes(output) # <<<<<<<<<<<<<< + * finally: + * cmpfr.mpfr_free_str(output) + */ + __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_output); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2329, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2329, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_output_as_bytes = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + } + + /* "mpfr.pyx":2331 + * output_as_bytes = bytes(output) + * finally: + * cmpfr.mpfr_free_str(output) # <<<<<<<<<<<<<< + * + * if sys.version_info < (3,): + */ + /*finally:*/ { + /*normal exit:*/{ + mpfr_free_str(__pyx_v_output); + goto __pyx_L6; + } + __pyx_L5_error:; + /*exception exit:*/{ + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14); + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_9); + __Pyx_XGOTREF(__pyx_t_10); + __Pyx_XGOTREF(__pyx_t_11); + __Pyx_XGOTREF(__pyx_t_12); + __Pyx_XGOTREF(__pyx_t_13); + __Pyx_XGOTREF(__pyx_t_14); + __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename; + { + mpfr_free_str(__pyx_v_output); + } + if (PY_MAJOR_VERSION >= 3) { + __Pyx_XGIVEREF(__pyx_t_12); + __Pyx_XGIVEREF(__pyx_t_13); + __Pyx_XGIVEREF(__pyx_t_14); + __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14); + } + __Pyx_XGIVEREF(__pyx_t_9); + __Pyx_XGIVEREF(__pyx_t_10); + __Pyx_XGIVEREF(__pyx_t_11); + __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11); + __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; + __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8; + goto __pyx_L1_error; + } + __pyx_L6:; + } + + /* "mpfr.pyx":2333 + * cmpfr.mpfr_free_str(output) + * + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return output_as_bytes + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2333, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple__4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2333, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 2333, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + + /* "mpfr.pyx":2334 + * + * if sys.version_info < (3,): + * return output_as_bytes # <<<<<<<<<<<<<< + * else: + * return output_as_bytes.decode('ascii') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_output_as_bytes); + __pyx_r = __pyx_v_output_as_bytes; + goto __pyx_L0; + + /* "mpfr.pyx":2333 + * cmpfr.mpfr_free_str(output) + * + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return output_as_bytes + * else: + */ + } + + /* "mpfr.pyx":2336 + * return output_as_bytes + * else: + * return output_as_bytes.decode('ascii') # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_decode_bytes(__pyx_v_output_as_bytes, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2336, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "mpfr.pyx":2310 + * ########################################################################### + * + * def mpfr_asprintf(object template, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Compute a string representation of 'op' based on the given template. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("mpfr.mpfr_asprintf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_template_bytes); + __Pyx_XDECREF(__pyx_v_output_as_bytes); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2343 + * ############################################################################### + * + * def mpfr_rint(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to an integer in the direction given by rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_267mpfr_rint(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_266mpfr_rint, "mpfr_rint(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to op rounded to an integer in the direction given by rnd.\n\n The returned value is zero when the result is exact, positive when it is\n greater than the original value of op, and negative when it is\n smaller. More precisely, the returned value is 0 when op is an integer\n representable in rop, 1 or \342\210\2221 when op is an integer that is not\n representable in rop, 2 or \342\210\2222 when op is not an integer.\n\n Note that no double rounding is performed; for instance, 10.5 (1010.1 in\n binary) is rounded by mpfr_rint with rounding to nearest to 12 (1100 in\n binary) in 2-bit precision, because the two enclosing numbers representable\n on two bits are 8 and 12, and the closest is 12. (If one first rounded to\n an integer, one would round 10.5 to 10 with even rounding, and then 10\n would be rounded to 8 again with even rounding.)\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_267mpfr_rint = {"mpfr_rint", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_267mpfr_rint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_266mpfr_rint}; +static PyObject *__pyx_pw_4mpfr_267mpfr_rint(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_rint (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2343, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2343, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint", 1, 3, 3, 1); __PYX_ERR(1, 2343, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2343, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint", 1, 3, 3, 2); __PYX_ERR(1, 2343, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_rint") < 0)) __PYX_ERR(1, 2343, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2343, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_rint", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2343, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_rint", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2343, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2343, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_266mpfr_rint(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_266mpfr_rint(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_rint", 1); + + /* "mpfr.pyx":2361 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2361, __pyx_L1_error) + + /* "mpfr.pyx":2362 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2362, __pyx_L1_error) + + /* "mpfr.pyx":2363 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_rint(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2363, __pyx_L1_error) + + /* "mpfr.pyx":2364 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_ceil(Mpfr_t rop not None, Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_rint((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2343 + * ############################################################################### + * + * def mpfr_rint(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to an integer in the direction given by rnd. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_rint", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2366 + * return cmpfr.mpfr_rint(&rop._value, &op._value, rnd) + * + * def mpfr_ceil(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next higher or equal representable integer. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_269mpfr_ceil(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_268mpfr_ceil, "mpfr_ceil(Mpfr_t rop, Mpfr_t op)\n\n Set rop to op rounded to the next higher or equal representable integer.\n\n The returned value is zero when the result is exact, positive when it is\n greater than the original value of op, and negative when it is\n smaller. More precisely, the returned value is 0 when op is an integer\n representable in rop, 1 or \342\210\2221 when op is an integer that is not\n representable in rop, 2 or \342\210\2222 when op is not an integer.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_269mpfr_ceil = {"mpfr_ceil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_269mpfr_ceil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_268mpfr_ceil}; +static PyObject *__pyx_pw_4mpfr_269mpfr_ceil(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_ceil (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2366, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2366, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_ceil", 1, 2, 2, 1); __PYX_ERR(1, 2366, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_ceil") < 0)) __PYX_ERR(1, 2366, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_ceil", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2366, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_ceil", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2366, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2366, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_268mpfr_ceil(__pyx_self, __pyx_v_rop, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_268mpfr_ceil(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_ceil", 1); + + /* "mpfr.pyx":2377 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * return cmpfr.mpfr_ceil(&rop._value, &op._value) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2377, __pyx_L1_error) + + /* "mpfr.pyx":2378 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_ceil(&rop._value, &op._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2378, __pyx_L1_error) + + /* "mpfr.pyx":2379 + * check_initialized(rop) + * check_initialized(op) + * return cmpfr.mpfr_ceil(&rop._value, &op._value) # <<<<<<<<<<<<<< + * + * def mpfr_floor(Mpfr_t rop not None, Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_ceil((&__pyx_v_rop->_value), (&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2366 + * return cmpfr.mpfr_rint(&rop._value, &op._value, rnd) + * + * def mpfr_ceil(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next higher or equal representable integer. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_ceil", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2381 + * return cmpfr.mpfr_ceil(&rop._value, &op._value) + * + * def mpfr_floor(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next lower or equal representable integer. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_271mpfr_floor(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_270mpfr_floor, "mpfr_floor(Mpfr_t rop, Mpfr_t op)\n\n Set rop to op rounded to the next lower or equal representable integer.\n\n The returned value is zero when the result is exact, positive when it is\n greater than the original value of op, and negative when it is\n smaller. More precisely, the returned value is 0 when op is an integer\n representable in rop, 1 or \342\210\2221 when op is an integer that is not\n representable in rop, 2 or \342\210\2222 when op is not an integer.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_271mpfr_floor = {"mpfr_floor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_271mpfr_floor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_270mpfr_floor}; +static PyObject *__pyx_pw_4mpfr_271mpfr_floor(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_floor (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2381, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2381, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_floor", 1, 2, 2, 1); __PYX_ERR(1, 2381, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_floor") < 0)) __PYX_ERR(1, 2381, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_floor", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2381, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_floor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2381, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2381, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_270mpfr_floor(__pyx_self, __pyx_v_rop, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_270mpfr_floor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_floor", 1); + + /* "mpfr.pyx":2392 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * return cmpfr.mpfr_floor(&rop._value, &op._value) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2392, __pyx_L1_error) + + /* "mpfr.pyx":2393 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_floor(&rop._value, &op._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2393, __pyx_L1_error) + + /* "mpfr.pyx":2394 + * check_initialized(rop) + * check_initialized(op) + * return cmpfr.mpfr_floor(&rop._value, &op._value) # <<<<<<<<<<<<<< + * + * def mpfr_round(Mpfr_t rop not None, Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_floor((&__pyx_v_rop->_value), (&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2394, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2381 + * return cmpfr.mpfr_ceil(&rop._value, &op._value) + * + * def mpfr_floor(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next lower or equal representable integer. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_floor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2396 + * return cmpfr.mpfr_floor(&rop._value, &op._value) + * + * def mpfr_round(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the nearest representable integer, rounding + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_273mpfr_round(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_272mpfr_round, "mpfr_round(Mpfr_t rop, Mpfr_t op)\n\n Set rop to op rounded to the nearest representable integer, rounding\n halfway cases away from zero (as in the roundTiesToAway mode of IEEE\n 754-2008).\n\n The returned value is zero when the result is exact, positive when it is\n greater than the original value of op, and negative when it is\n smaller. More precisely, the returned value is 0 when op is an integer\n representable in rop, 1 or \342\210\2221 when op is an integer that is not\n representable in rop, 2 or \342\210\2222 when op is not an integer.\n\n Note that mpfr_round is different from mpfr_rint called with the rounding\n to nearest mode (where halfway cases are rounded to an even integer or\n significand). Note also that no double rounding is performed; for instance,\n 10.5 (1010.1 in binary) is rounded by mpfr_rint with rounding to nearest to\n 12 (1100 in binary) in 2-bit precision, because the two enclosing numbers\n representable on two bits are 8 and 12, and the closest is 12. (If one\n first rounded to an integer, one would round 10.5 to 10 with even rounding,\n and then 10 would be rounded to 8 again with even rounding.)\n "); +static PyMethodDef __pyx_mdef_4mpfr_273mpfr_round = {"mpfr_round", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_273mpfr_round, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_272mpfr_round}; +static PyObject *__pyx_pw_4mpfr_273mpfr_round(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_round (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2396, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2396, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_round", 1, 2, 2, 1); __PYX_ERR(1, 2396, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_round") < 0)) __PYX_ERR(1, 2396, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_round", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2396, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_round", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2396, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2396, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_272mpfr_round(__pyx_self, __pyx_v_rop, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_272mpfr_round(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_round", 1); + + /* "mpfr.pyx":2417 + * and then 10 would be rounded to 8 again with even rounding.) + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * return cmpfr.mpfr_round(&rop._value, &op._value) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2417, __pyx_L1_error) + + /* "mpfr.pyx":2418 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_round(&rop._value, &op._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2418, __pyx_L1_error) + + /* "mpfr.pyx":2419 + * check_initialized(rop) + * check_initialized(op) + * return cmpfr.mpfr_round(&rop._value, &op._value) # <<<<<<<<<<<<<< + * + * def mpfr_roundeven(Mpfr_t rop not None, Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_round((&__pyx_v_rop->_value), (&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2419, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2396 + * return cmpfr.mpfr_floor(&rop._value, &op._value) + * + * def mpfr_round(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the nearest representable integer, rounding + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_round", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2421 + * return cmpfr.mpfr_round(&rop._value, &op._value) + * + * def mpfr_roundeven(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the nearest representable integer, rounding + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_275mpfr_roundeven(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_274mpfr_roundeven, "mpfr_roundeven(Mpfr_t rop, Mpfr_t op)\n\n Set rop to op rounded to the nearest representable integer, rounding\n halfway cases with the even-rounding rule.\n\n The returned value is zero when the result is exact, positive when it is\n greater than the original value of op, and negative when it is\n smaller. More precisely, the returned value is 0 when op is an integer\n representable in rop, 1 or \342\210\2221 when op is an integer that is not\n representable in rop, 2 or \342\210\2222 when op is not an integer.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_275mpfr_roundeven = {"mpfr_roundeven", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_275mpfr_roundeven, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_274mpfr_roundeven}; +static PyObject *__pyx_pw_4mpfr_275mpfr_roundeven(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_roundeven (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2421, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2421, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_roundeven", 1, 2, 2, 1); __PYX_ERR(1, 2421, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_roundeven") < 0)) __PYX_ERR(1, 2421, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_roundeven", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2421, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_roundeven", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2421, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2421, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_274mpfr_roundeven(__pyx_self, __pyx_v_rop, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_274mpfr_roundeven(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_roundeven", 1); + + /* "mpfr.pyx":2433 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * return cmpfr.mpfr_roundeven(&rop._value, &op._value) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2433, __pyx_L1_error) + + /* "mpfr.pyx":2434 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_roundeven(&rop._value, &op._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2434, __pyx_L1_error) + + /* "mpfr.pyx":2435 + * check_initialized(rop) + * check_initialized(op) + * return cmpfr.mpfr_roundeven(&rop._value, &op._value) # <<<<<<<<<<<<<< + * + * def mpfr_trunc(Mpfr_t rop not None, Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_roundeven((&__pyx_v_rop->_value), (&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2421 + * return cmpfr.mpfr_round(&rop._value, &op._value) + * + * def mpfr_roundeven(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the nearest representable integer, rounding + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_roundeven", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2437 + * return cmpfr.mpfr_roundeven(&rop._value, &op._value) + * + * def mpfr_trunc(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next representable integer toward zero. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_277mpfr_trunc(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_276mpfr_trunc, "mpfr_trunc(Mpfr_t rop, Mpfr_t op)\n\n Set rop to op rounded to the next representable integer toward zero.\n\n The returned value is zero when the result is exact, positive when it is\n greater than the original value of op, and negative when it is\n smaller. More precisely, the returned value is 0 when op is an integer\n representable in rop, 1 or \342\210\2221 when op is an integer that is not\n representable in rop, 2 or \342\210\2222 when op is not an integer.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_277mpfr_trunc = {"mpfr_trunc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_277mpfr_trunc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_276mpfr_trunc}; +static PyObject *__pyx_pw_4mpfr_277mpfr_trunc(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_trunc (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2437, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2437, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_trunc", 1, 2, 2, 1); __PYX_ERR(1, 2437, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_trunc") < 0)) __PYX_ERR(1, 2437, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_trunc", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2437, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_trunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2437, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2437, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_276mpfr_trunc(__pyx_self, __pyx_v_rop, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_276mpfr_trunc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_trunc", 1); + + /* "mpfr.pyx":2448 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * return cmpfr.mpfr_trunc(&rop._value, &op._value) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2448, __pyx_L1_error) + + /* "mpfr.pyx":2449 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_trunc(&rop._value, &op._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2449, __pyx_L1_error) + + /* "mpfr.pyx":2450 + * check_initialized(rop) + * check_initialized(op) + * return cmpfr.mpfr_trunc(&rop._value, &op._value) # <<<<<<<<<<<<<< + * + * def mpfr_rint_ceil(Mpfr_t rop not None, Mpfr_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_trunc((&__pyx_v_rop->_value), (&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2437 + * return cmpfr.mpfr_roundeven(&rop._value, &op._value) + * + * def mpfr_trunc(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next representable integer toward zero. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_trunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2452 + * return cmpfr.mpfr_trunc(&rop._value, &op._value) + * + * def mpfr_rint_ceil(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_279mpfr_rint_ceil(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_278mpfr_rint_ceil, "mpfr_rint_ceil(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to op rounded to the next higher or equal integer.\n\n If the result is not representable, it is rounded in the direction rnd. The\n returned value is the ternary value associated with the considered\n round-to-integer function (regarded in the same way as any other\n mathematical function).\n\n Unlike mpfr_ceil, this function does perform a double rounding: first op is\n rounded to the next higher or equal integer, then this integer (if not\n representable) is rounded in the given direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_279mpfr_rint_ceil = {"mpfr_rint_ceil", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_279mpfr_rint_ceil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_278mpfr_rint_ceil}; +static PyObject *__pyx_pw_4mpfr_279mpfr_rint_ceil(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_rint_ceil (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2452, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2452, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint_ceil", 1, 3, 3, 1); __PYX_ERR(1, 2452, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2452, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint_ceil", 1, 3, 3, 2); __PYX_ERR(1, 2452, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_rint_ceil") < 0)) __PYX_ERR(1, 2452, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2453, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_rint_ceil", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2452, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_rint_ceil", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2452, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2452, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_278mpfr_rint_ceil(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_278mpfr_rint_ceil(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_rint_ceil", 1); + + /* "mpfr.pyx":2467 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2467, __pyx_L1_error) + + /* "mpfr.pyx":2468 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint_ceil(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2468, __pyx_L1_error) + + /* "mpfr.pyx":2469 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_rint_ceil(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2469, __pyx_L1_error) + + /* "mpfr.pyx":2470 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint_ceil(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_rint_floor(Mpfr_t rop not None, Mpfr_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_rint_ceil((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2452 + * return cmpfr.mpfr_trunc(&rop._value, &op._value) + * + * def mpfr_rint_ceil(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_rint_ceil", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2472 + * return cmpfr.mpfr_rint_ceil(&rop._value, &op._value, rnd) + * + * def mpfr_rint_floor(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_281mpfr_rint_floor(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_280mpfr_rint_floor, "mpfr_rint_floor(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to op rounded to the next lower or equal integer.\n\n If the result is not representable, it is rounded in the direction rnd. The\n returned value is the ternary value associated with the considered\n round-to-integer function (regarded in the same way as any other\n mathematical function).\n\n Unlike mpfr_floor, this function does perform a double rounding: first op\n is rounded to the next lower or equal integer, then this integer (if not\n representable) is rounded in the given direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_281mpfr_rint_floor = {"mpfr_rint_floor", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_281mpfr_rint_floor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_280mpfr_rint_floor}; +static PyObject *__pyx_pw_4mpfr_281mpfr_rint_floor(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_rint_floor (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2472, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2472, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint_floor", 1, 3, 3, 1); __PYX_ERR(1, 2472, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2472, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint_floor", 1, 3, 3, 2); __PYX_ERR(1, 2472, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_rint_floor") < 0)) __PYX_ERR(1, 2472, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2473, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_rint_floor", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2472, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_rint_floor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2472, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2472, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_280mpfr_rint_floor(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_280mpfr_rint_floor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_rint_floor", 1); + + /* "mpfr.pyx":2487 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2487, __pyx_L1_error) + + /* "mpfr.pyx":2488 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint_floor(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2488, __pyx_L1_error) + + /* "mpfr.pyx":2489 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_rint_floor(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2489, __pyx_L1_error) + + /* "mpfr.pyx":2490 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint_floor(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_rint_round(Mpfr_t rop not None, Mpfr_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_rint_floor((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2472 + * return cmpfr.mpfr_rint_ceil(&rop._value, &op._value, rnd) + * + * def mpfr_rint_floor(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_rint_floor", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2492 + * return cmpfr.mpfr_rint_floor(&rop._value, &op._value, rnd) + * + * def mpfr_rint_round(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_283mpfr_rint_round(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_282mpfr_rint_round, "mpfr_rint_round(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to op rounded to the nearest integer, rounding halfway cases\n away from zero.\n\n If the result is not representable, it is rounded in the direction rnd. The\n returned value is the ternary value associated with the considered\n round-to-integer function (regarded in the same way as any other\n mathematical function).\n\n Unlike mpfr_round, this function does perform a double rounding: first op\n is rounded to the nearest integer, then this nearest integer (if not\n representable) is rounded in the given direction rnd.\n\n For example, mpfr_rint_round with rounding to nearest and a precision of\n two bits rounds 6.5 to 7 (halfway cases away from zero), then 7 is rounded\n to 8 by the round-even rule, despite the fact that 6 is also representable\n on two bits, and is closer to 6.5 than 8.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_283mpfr_rint_round = {"mpfr_rint_round", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_283mpfr_rint_round, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_282mpfr_rint_round}; +static PyObject *__pyx_pw_4mpfr_283mpfr_rint_round(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_rint_round (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2492, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2492, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint_round", 1, 3, 3, 1); __PYX_ERR(1, 2492, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2492, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint_round", 1, 3, 3, 2); __PYX_ERR(1, 2492, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_rint_round") < 0)) __PYX_ERR(1, 2492, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2493, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_rint_round", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2492, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_rint_round", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2492, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2492, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_282mpfr_rint_round(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_282mpfr_rint_round(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_rint_round", 1); + + /* "mpfr.pyx":2513 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2513, __pyx_L1_error) + + /* "mpfr.pyx":2514 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint_round(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2514, __pyx_L1_error) + + /* "mpfr.pyx":2515 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_rint_round(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2515, __pyx_L1_error) + + /* "mpfr.pyx":2516 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint_round(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_rint_roundeven(Mpfr_t rop not None, Mpfr_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_rint_round((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2492 + * return cmpfr.mpfr_rint_floor(&rop._value, &op._value, rnd) + * + * def mpfr_rint_round(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_rint_round", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2518 + * return cmpfr.mpfr_rint_round(&rop._value, &op._value, rnd) + * + * def mpfr_rint_roundeven(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_285mpfr_rint_roundeven(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_284mpfr_rint_roundeven, "mpfr_rint_roundeven(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to op rounded to the nearest integer, rounding halfway cases\n to the nearest even integer.\n\n If the result is not representable, it is rounded in the direction rnd. The\n returned value is the ternary value associated with the considered\n round-to-integer function (regarded in the same way as any other\n mathematical function).\n\n Unlike mpfr_roundeven, this function does perform a double rounding: first\n op is rounded to the next integer toward zero, then this integer (if not\n representable) is rounded in the given direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_285mpfr_rint_roundeven = {"mpfr_rint_roundeven", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_285mpfr_rint_roundeven, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_284mpfr_rint_roundeven}; +static PyObject *__pyx_pw_4mpfr_285mpfr_rint_roundeven(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_rint_roundeven (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2518, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2518, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint_roundeven", 1, 3, 3, 1); __PYX_ERR(1, 2518, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2518, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint_roundeven", 1, 3, 3, 2); __PYX_ERR(1, 2518, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_rint_roundeven") < 0)) __PYX_ERR(1, 2518, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2519, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_rint_roundeven", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2518, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_rint_roundeven", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2518, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2518, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_284mpfr_rint_roundeven(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_284mpfr_rint_roundeven(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_rint_roundeven", 1); + + /* "mpfr.pyx":2534 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2534, __pyx_L1_error) + + /* "mpfr.pyx":2535 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint_roundeven(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2535, __pyx_L1_error) + + /* "mpfr.pyx":2536 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_rint_roundeven(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2536, __pyx_L1_error) + + /* "mpfr.pyx":2537 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint_roundeven(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_rint_trunc(Mpfr_t rop not None, Mpfr_t op not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_rint_roundeven((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2518 + * return cmpfr.mpfr_rint_round(&rop._value, &op._value, rnd) + * + * def mpfr_rint_roundeven(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_rint_roundeven", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2539 + * return cmpfr.mpfr_rint_roundeven(&rop._value, &op._value, rnd) + * + * def mpfr_rint_trunc(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_287mpfr_rint_trunc(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_286mpfr_rint_trunc, "mpfr_rint_trunc(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to op rounded to the next integer toward zero.\n\n If the result is not representable, it is rounded in the direction rnd. The\n returned value is the ternary value associated with the considered\n round-to-integer function (regarded in the same way as any other\n mathematical function).\n\n Unlike mpfr_trunc, this function does perform a double rounding: first op\n is rounded to the next integer toward zero, then this integer (if not\n representable) is rounded in the given direction rnd.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_287mpfr_rint_trunc = {"mpfr_rint_trunc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_287mpfr_rint_trunc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_286mpfr_rint_trunc}; +static PyObject *__pyx_pw_4mpfr_287mpfr_rint_trunc(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_rint_trunc (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2539, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2539, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint_trunc", 1, 3, 3, 1); __PYX_ERR(1, 2539, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2539, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_rint_trunc", 1, 3, 3, 2); __PYX_ERR(1, 2539, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_rint_trunc") < 0)) __PYX_ERR(1, 2539, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2540, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_rint_trunc", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2539, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_rint_trunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2539, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2539, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_286mpfr_rint_trunc(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_286mpfr_rint_trunc(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_rint_trunc", 1); + + /* "mpfr.pyx":2554 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2554, __pyx_L1_error) + + /* "mpfr.pyx":2555 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint_trunc(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2555, __pyx_L1_error) + + /* "mpfr.pyx":2556 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_rint_trunc(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2556, __pyx_L1_error) + + /* "mpfr.pyx":2557 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_rint_trunc(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_frac(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_rint_trunc((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2557, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2539 + * return cmpfr.mpfr_rint_roundeven(&rop._value, &op._value, rnd) + * + * def mpfr_rint_trunc(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_rint_trunc", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2559 + * return cmpfr.mpfr_rint_trunc(&rop._value, &op._value, rnd) + * + * def mpfr_frac(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the fractional part of op, having the same sign as op, rounded + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_289mpfr_frac(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_288mpfr_frac, "mpfr_frac(Mpfr_t rop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set rop to the fractional part of op, having the same sign as op, rounded\n in the direction rnd (unlike in mpfr_rint, rnd affects only how the exact\n fractional part is rounded, not how the fractional part is generated).\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_289mpfr_frac = {"mpfr_frac", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_289mpfr_frac, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_288mpfr_frac}; +static PyObject *__pyx_pw_4mpfr_289mpfr_frac(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_frac (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2559, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2559, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_frac", 1, 3, 3, 1); __PYX_ERR(1, 2559, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2559, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_frac", 1, 3, 3, 2); __PYX_ERR(1, 2559, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_frac") < 0)) __PYX_ERR(1, 2559, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2559, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_frac", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2559, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_frac", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2559, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2559, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_288mpfr_frac(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_288mpfr_frac(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_frac", 1); + + /* "mpfr.pyx":2566 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2566, __pyx_L1_error) + + /* "mpfr.pyx":2567 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_frac(&rop._value, &op._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2567, __pyx_L1_error) + + /* "mpfr.pyx":2568 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_frac(&rop._value, &op._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2568, __pyx_L1_error) + + /* "mpfr.pyx":2569 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_frac(&rop._value, &op._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_modf(Mpfr_t iop not None, Mpfr_t fop not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_frac((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2559 + * return cmpfr.mpfr_rint_trunc(&rop._value, &op._value, rnd) + * + * def mpfr_frac(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the fractional part of op, having the same sign as op, rounded + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_frac", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2571 + * return cmpfr.mpfr_frac(&rop._value, &op._value, rnd) + * + * def mpfr_modf(Mpfr_t iop not None, Mpfr_t fop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_291mpfr_modf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_290mpfr_modf, "mpfr_modf(Mpfr_t iop, Mpfr_t fop, Mpfr_t op, mpfr_rnd_t rnd)\n\n Set simultaneously iop to the integral part of op and fop to the fractional\n part of op, rounded in the direction rnd with the corresponding precision\n of iop and fop.\n\n Equivalent to mpfr_trunc(iop, op, rnd) and mpfr_frac(fop, op, rnd). The\n variables iop and fop must be different.\n\n Return a pair (int_ternary, frac_ternary) of the corresponding ternary\n values. Note that this differs from the original mpfr_modf function from\n MPFR, which combines the ternary values into a single int return.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_291mpfr_modf = {"mpfr_modf", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_291mpfr_modf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_290mpfr_modf}; +static PyObject *__pyx_pw_4mpfr_291mpfr_modf(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_iop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_fop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_modf (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_iop,&__pyx_n_s_fop,&__pyx_n_s_op,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_iop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2571, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2571, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_modf", 1, 4, 4, 1); __PYX_ERR(1, 2571, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2571, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_modf", 1, 4, 4, 2); __PYX_ERR(1, 2571, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2571, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_modf", 1, 4, 4, 3); __PYX_ERR(1, 2571, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_modf") < 0)) __PYX_ERR(1, 2571, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_iop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_fop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2572, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_modf", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2571, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_modf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iop), __pyx_ptype_4mpfr_Mpfr_t, 0, "iop", 0))) __PYX_ERR(1, 2571, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fop), __pyx_ptype_4mpfr_Mpfr_t, 0, "fop", 0))) __PYX_ERR(1, 2571, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2572, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_290mpfr_modf(__pyx_self, __pyx_v_iop, __pyx_v_fop, __pyx_v_op, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_290mpfr_modf(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_iop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_fop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_rnd_t __pyx_v_rnd) { + int __pyx_v_ternary_pair; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_modf", 1); + + /* "mpfr.pyx":2588 + * cdef int ternary_pair + * + * check_initialized(iop) # <<<<<<<<<<<<<< + * check_initialized(fop) + * check_initialized(op) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_iop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2588, __pyx_L1_error) + + /* "mpfr.pyx":2589 + * + * check_initialized(iop) + * check_initialized(fop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_fop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2589, __pyx_L1_error) + + /* "mpfr.pyx":2590 + * check_initialized(iop) + * check_initialized(fop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * ternary_pair = cmpfr.mpfr_modf( + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2590, __pyx_L1_error) + + /* "mpfr.pyx":2591 + * check_initialized(fop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * ternary_pair = cmpfr.mpfr_modf( + * &iop._value, &fop._value, &op._value, rnd + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2591, __pyx_L1_error) + + /* "mpfr.pyx":2592 + * check_initialized(op) + * check_rounding_mode(rnd) + * ternary_pair = cmpfr.mpfr_modf( # <<<<<<<<<<<<<< + * &iop._value, &fop._value, &op._value, rnd + * ) + */ + __pyx_v_ternary_pair = mpfr_modf((&__pyx_v_iop->_value), (&__pyx_v_fop->_value), (&__pyx_v_op->_value), __pyx_v_rnd); + + /* "mpfr.pyx":2595 + * &iop._value, &fop._value, &op._value, rnd + * ) + * return decode_ternary_pair(ternary_pair) # <<<<<<<<<<<<<< + * + * def mpfr_fmod(Mpfr_t r not None, Mpfr_t x not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __pyx_f_4mpfr_decode_ternary_pair(__pyx_v_ternary_pair); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2571 + * return cmpfr.mpfr_frac(&rop._value, &op._value, rnd) + * + * def mpfr_modf(Mpfr_t iop not None, Mpfr_t fop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_modf", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2597 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_fmod(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_293mpfr_fmod(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_292mpfr_fmod, "mpfr_fmod(Mpfr_t r, Mpfr_t x, Mpfr_t y, mpfr_rnd_t rnd)\n\n Set r to x reduced modulo y, rounded in direction rnd.\n\n Set r to the value of x - n * y, rounded according to the direction\n rnd, where n is the integer quotient of x divided by y, rounded toward\n zero.\n\n Special values are handled as described in Section F.9.7.1 of the ISO C99\n standard: If x is infinite or y is zero, r is NaN. If y is infinite\n and x is finite, r is x rounded to the precision of r. If r is\n zero, it has the sign of x. The return value is the ternary value\n corresponding to r.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_293mpfr_fmod = {"mpfr_fmod", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_293mpfr_fmod, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_292mpfr_fmod}; +static PyObject *__pyx_pw_4mpfr_293mpfr_fmod(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_fmod (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_r,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2597, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2597, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmod", 1, 4, 4, 1); __PYX_ERR(1, 2597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2597, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmod", 1, 4, 4, 2); __PYX_ERR(1, 2597, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2597, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmod", 1, 4, 4, 3); __PYX_ERR(1, 2597, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_fmod") < 0)) __PYX_ERR(1, 2597, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_r = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_y = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2598, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_fmod", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2597, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_fmod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_ptype_4mpfr_Mpfr_t, 0, "r", 0))) __PYX_ERR(1, 2597, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 2597, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4mpfr_Mpfr_t, 0, "y", 0))) __PYX_ERR(1, 2598, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_292mpfr_fmod(__pyx_self, __pyx_v_r, __pyx_v_x, __pyx_v_y, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_292mpfr_fmod(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_fmod", 1); + + /* "mpfr.pyx":2613 + * + * """ + * check_initialized(r) # <<<<<<<<<<<<<< + * check_initialized(x) + * check_initialized(y) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_r); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2613, __pyx_L1_error) + + /* "mpfr.pyx":2614 + * """ + * check_initialized(r) + * check_initialized(x) # <<<<<<<<<<<<<< + * check_initialized(y) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2614, __pyx_L1_error) + + /* "mpfr.pyx":2615 + * check_initialized(r) + * check_initialized(x) + * check_initialized(y) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fmod(&r._value, &x._value, &y._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_y); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2615, __pyx_L1_error) + + /* "mpfr.pyx":2616 + * check_initialized(x) + * check_initialized(y) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_fmod(&r._value, &x._value, &y._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2616, __pyx_L1_error) + + /* "mpfr.pyx":2617 + * check_initialized(y) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_fmod(&r._value, &x._value, &y._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_fmodquo(Mpfr_t r not None, Mpfr_t x not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_fmod((&__pyx_v_r->_value), (&__pyx_v_x->_value), (&__pyx_v_y->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2597 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_fmod(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_fmod", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2619 + * return cmpfr.mpfr_fmod(&r._value, &x._value, &y._value, rnd) + * + * def mpfr_fmodquo(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_295mpfr_fmodquo(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_294mpfr_fmodquo, "mpfr_fmodquo(Mpfr_t r, Mpfr_t x, Mpfr_t y, mpfr_rnd_t rnd)\n\n Set r to the value of x - n * y, rounded according to the direction rnd,\n where n is the integer quotient of x divided by y, rounded toward zero.\n\n Also return the low bits of the quotient.\n\n Special values are handled as described in Section F.9.7.1 of the ISO C99\n standard: If x is infinite or y is zero, r is NaN. If y is infinite and x\n is finite, r is x rounded to the precision of r. If r is zero, it has the\n sign of x.\n\n Returns a pair (ternary, quotient) where ternary is the ternary value\n corresponding to r, and q gives the low significant bits from the quotient\n n (more precisely the number of bits in a C long minus one), with the\n sign of x divided by y (except if those low bits are all zero, in which\n case zero is returned). Note that x may be so large in magnitude relative\n to y that an exact representation of the quotient is not practical.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_295mpfr_fmodquo = {"mpfr_fmodquo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_295mpfr_fmodquo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_294mpfr_fmodquo}; +static PyObject *__pyx_pw_4mpfr_295mpfr_fmodquo(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_fmodquo (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_r,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2619, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2619, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmodquo", 1, 4, 4, 1); __PYX_ERR(1, 2619, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2619, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmodquo", 1, 4, 4, 2); __PYX_ERR(1, 2619, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2619, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_fmodquo", 1, 4, 4, 3); __PYX_ERR(1, 2619, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_fmodquo") < 0)) __PYX_ERR(1, 2619, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_r = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_y = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2620, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_fmodquo", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2619, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_fmodquo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_ptype_4mpfr_Mpfr_t, 0, "r", 0))) __PYX_ERR(1, 2619, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 2619, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4mpfr_Mpfr_t, 0, "y", 0))) __PYX_ERR(1, 2620, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_294mpfr_fmodquo(__pyx_self, __pyx_v_r, __pyx_v_x, __pyx_v_y, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_294mpfr_fmodquo(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, mpfr_rnd_t __pyx_v_rnd) { + long __pyx_v_quotient; + int __pyx_v_ternary; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_fmodquo", 1); + + /* "mpfr.pyx":2642 + * cdef long int quotient + * + * check_initialized(r) # <<<<<<<<<<<<<< + * check_initialized(x) + * check_initialized(y) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_r); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2642, __pyx_L1_error) + + /* "mpfr.pyx":2643 + * + * check_initialized(r) + * check_initialized(x) # <<<<<<<<<<<<<< + * check_initialized(y) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2643, __pyx_L1_error) + + /* "mpfr.pyx":2644 + * check_initialized(r) + * check_initialized(x) + * check_initialized(y) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * ternary = cmpfr.mpfr_fmodquo( + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_y); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2644, __pyx_L1_error) + + /* "mpfr.pyx":2645 + * check_initialized(x) + * check_initialized(y) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * ternary = cmpfr.mpfr_fmodquo( + * &r._value, "ient, &x._value, &y._value, rnd + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2645, __pyx_L1_error) + + /* "mpfr.pyx":2646 + * check_initialized(y) + * check_rounding_mode(rnd) + * ternary = cmpfr.mpfr_fmodquo( # <<<<<<<<<<<<<< + * &r._value, "ient, &x._value, &y._value, rnd + * ) + */ + __pyx_v_ternary = mpfr_fmodquo((&__pyx_v_r->_value), (&__pyx_v_quotient), (&__pyx_v_x->_value), (&__pyx_v_y->_value), __pyx_v_rnd); + + /* "mpfr.pyx":2649 + * &r._value, "ient, &x._value, &y._value, rnd + * ) + * return ternary, quotient # <<<<<<<<<<<<<< + * + * def mpfr_remainder(Mpfr_t r not None, Mpfr_t x not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ternary); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_quotient); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(1, 2649, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(1, 2649, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2619 + * return cmpfr.mpfr_fmod(&r._value, &x._value, &y._value, rnd) + * + * def mpfr_fmodquo(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("mpfr.mpfr_fmodquo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2651 + * return ternary, quotient + * + * def mpfr_remainder(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_297mpfr_remainder(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_296mpfr_remainder, "mpfr_remainder(Mpfr_t r, Mpfr_t x, Mpfr_t y, mpfr_rnd_t rnd)\n\n Set r to x reduced modulo y, rounded in direction rnd.\n\n Set r to the value of x - n * y, rounded according to the direction rnd,\n where n is the integer quotient of x divided by y, rounded to the nearest\n integer (ties rounded to even).\n\n Special values are handled as described in Section F.9.7.1 of the ISO C99\n standard: If x is infinite or y is zero, r is NaN. If y is infinite\n and x is finite, r is x rounded to the precision of r. If r is\n zero, it has the sign of x. The return value is the ternary value\n corresponding to r.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_297mpfr_remainder = {"mpfr_remainder", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_297mpfr_remainder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_296mpfr_remainder}; +static PyObject *__pyx_pw_4mpfr_297mpfr_remainder(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_remainder (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_r,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2651, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2651, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_remainder", 1, 4, 4, 1); __PYX_ERR(1, 2651, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2651, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_remainder", 1, 4, 4, 2); __PYX_ERR(1, 2651, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2651, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_remainder", 1, 4, 4, 3); __PYX_ERR(1, 2651, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_remainder") < 0)) __PYX_ERR(1, 2651, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_r = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_y = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2652, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_remainder", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2651, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_remainder", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_ptype_4mpfr_Mpfr_t, 0, "r", 0))) __PYX_ERR(1, 2651, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 2651, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4mpfr_Mpfr_t, 0, "y", 0))) __PYX_ERR(1, 2652, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_296mpfr_remainder(__pyx_self, __pyx_v_r, __pyx_v_x, __pyx_v_y, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_296mpfr_remainder(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_remainder", 1); + + /* "mpfr.pyx":2667 + * + * """ + * check_initialized(r) # <<<<<<<<<<<<<< + * check_initialized(x) + * check_initialized(y) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_r); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2667, __pyx_L1_error) + + /* "mpfr.pyx":2668 + * """ + * check_initialized(r) + * check_initialized(x) # <<<<<<<<<<<<<< + * check_initialized(y) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2668, __pyx_L1_error) + + /* "mpfr.pyx":2669 + * check_initialized(r) + * check_initialized(x) + * check_initialized(y) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_remainder(&r._value, &x._value, &y._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_y); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2669, __pyx_L1_error) + + /* "mpfr.pyx":2670 + * check_initialized(x) + * check_initialized(y) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_remainder(&r._value, &x._value, &y._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2670, __pyx_L1_error) + + /* "mpfr.pyx":2671 + * check_initialized(y) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_remainder(&r._value, &x._value, &y._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_remquo(Mpfr_t r not None, Mpfr_t x not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_remainder((&__pyx_v_r->_value), (&__pyx_v_x->_value), (&__pyx_v_y->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2651 + * return ternary, quotient + * + * def mpfr_remainder(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_remainder", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2673 + * return cmpfr.mpfr_remainder(&r._value, &x._value, &y._value, rnd) + * + * def mpfr_remquo(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_299mpfr_remquo(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_298mpfr_remquo, "mpfr_remquo(Mpfr_t r, Mpfr_t x, Mpfr_t y, mpfr_rnd_t rnd)\n\n Set r to the value of x - n * y, rounded according to the direction rnd,\n where n is the integer quotient of x divided by y, rounded to the nearest\n integer (ties rounded to even).\n\n Also return the low bits of the quotient.\n\n Special values are handled as described in Section F.9.7.1 of the ISO C99\n standard: If x is infinite or y is zero, r is NaN. If y is infinite and x\n is finite, r is x rounded to the precision of r. If r is zero, it has the\n sign of x.\n\n Returns a pair (ternary, quotient) where ternary is the ternary value\n corresponding to r, and q gives the low significant bits from the quotient\n n (more precisely the number of bits in a C long minus one), with the\n sign of x divided by y (except if those low bits are all zero, in which\n case zero is returned). Note that x may be so large in magnitude relative\n to y that an exact representation of the quotient is not practical.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_299mpfr_remquo = {"mpfr_remquo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_299mpfr_remquo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_298mpfr_remquo}; +static PyObject *__pyx_pw_4mpfr_299mpfr_remquo(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_remquo (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_r,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2673, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2673, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_remquo", 1, 4, 4, 1); __PYX_ERR(1, 2673, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2673, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_remquo", 1, 4, 4, 2); __PYX_ERR(1, 2673, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2673, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_remquo", 1, 4, 4, 3); __PYX_ERR(1, 2673, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_remquo") < 0)) __PYX_ERR(1, 2673, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_r = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_y = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2674, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_remquo", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2673, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_remquo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_ptype_4mpfr_Mpfr_t, 0, "r", 0))) __PYX_ERR(1, 2673, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 2673, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4mpfr_Mpfr_t, 0, "y", 0))) __PYX_ERR(1, 2674, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_298mpfr_remquo(__pyx_self, __pyx_v_r, __pyx_v_x, __pyx_v_y, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_298mpfr_remquo(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_r, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y, mpfr_rnd_t __pyx_v_rnd) { + long __pyx_v_quotient; + int __pyx_v_ternary; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_remquo", 1); + + /* "mpfr.pyx":2697 + * cdef long int quotient + * + * check_initialized(r) # <<<<<<<<<<<<<< + * check_initialized(x) + * check_initialized(y) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_r); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2697, __pyx_L1_error) + + /* "mpfr.pyx":2698 + * + * check_initialized(r) + * check_initialized(x) # <<<<<<<<<<<<<< + * check_initialized(y) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2698, __pyx_L1_error) + + /* "mpfr.pyx":2699 + * check_initialized(r) + * check_initialized(x) + * check_initialized(y) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * ternary = cmpfr.mpfr_remquo( + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_y); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2699, __pyx_L1_error) + + /* "mpfr.pyx":2700 + * check_initialized(x) + * check_initialized(y) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * ternary = cmpfr.mpfr_remquo( + * &r._value, "ient, &x._value, &y._value, rnd + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2700, __pyx_L1_error) + + /* "mpfr.pyx":2701 + * check_initialized(y) + * check_rounding_mode(rnd) + * ternary = cmpfr.mpfr_remquo( # <<<<<<<<<<<<<< + * &r._value, "ient, &x._value, &y._value, rnd + * ) + */ + __pyx_v_ternary = mpfr_remquo((&__pyx_v_r->_value), (&__pyx_v_quotient), (&__pyx_v_x->_value), (&__pyx_v_y->_value), __pyx_v_rnd); + + /* "mpfr.pyx":2704 + * &r._value, "ient, &x._value, &y._value, rnd + * ) + * return ternary, quotient # <<<<<<<<<<<<<< + * + * def mpfr_integer_p(Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ternary); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_quotient); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(1, 2704, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(1, 2704, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2673 + * return cmpfr.mpfr_remainder(&r._value, &x._value, &y._value, rnd) + * + * def mpfr_remquo(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("mpfr.mpfr_remquo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2706 + * return ternary, quotient + * + * def mpfr_integer_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an integer. Return False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_301mpfr_integer_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_300mpfr_integer_p, "mpfr_integer_p(Mpfr_t op)\n\n Return True if op is an integer. Return False otherwise.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_301mpfr_integer_p = {"mpfr_integer_p", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_301mpfr_integer_p, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_300mpfr_integer_p}; +static PyObject *__pyx_pw_4mpfr_301mpfr_integer_p(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_integer_p (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2706, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_integer_p") < 0)) __PYX_ERR(1, 2706, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_integer_p", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 2706, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_integer_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2706, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_300mpfr_integer_p(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_300mpfr_integer_p(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_integer_p", 1); + + /* "mpfr.pyx":2711 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_integer_p(&op._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2711, __pyx_L1_error) + + /* "mpfr.pyx":2712 + * """ + * check_initialized(op) + * return bool(cmpfr.mpfr_integer_p(&op._value)) # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_integer_p((&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 2712, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2706 + * return ternary, quotient + * + * def mpfr_integer_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an integer. Return False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_integer_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2719 + * ############################################################################### + * + * def mpfr_set_default_rounding_mode(cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the default rounding mode to rnd. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_303mpfr_set_default_rounding_mode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_302mpfr_set_default_rounding_mode, "mpfr_set_default_rounding_mode(mpfr_rnd_t rnd)\n\n Set the default rounding mode to rnd.\n\n The default rounding mode is to nearest initially.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_303mpfr_set_default_rounding_mode = {"mpfr_set_default_rounding_mode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_303mpfr_set_default_rounding_mode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_302mpfr_set_default_rounding_mode}; +static PyObject *__pyx_pw_4mpfr_303mpfr_set_default_rounding_mode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_default_rounding_mode (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2719, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_default_rounding_mode") < 0)) __PYX_ERR(1, 2719, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[0])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2719, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_default_rounding_mode", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 2719, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_default_rounding_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_302mpfr_set_default_rounding_mode(__pyx_self, __pyx_v_rnd); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_302mpfr_set_default_rounding_mode(CYTHON_UNUSED PyObject *__pyx_self, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_default_rounding_mode", 1); + + /* "mpfr.pyx":2726 + * + * """ + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * cmpfr.mpfr_set_default_rounding_mode(rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2726, __pyx_L1_error) + + /* "mpfr.pyx":2727 + * """ + * check_rounding_mode(rnd) + * cmpfr.mpfr_set_default_rounding_mode(rnd) # <<<<<<<<<<<<<< + * + * def mpfr_get_default_rounding_mode(): + */ + mpfr_set_default_rounding_mode(__pyx_v_rnd); + + /* "mpfr.pyx":2719 + * ############################################################################### + * + * def mpfr_set_default_rounding_mode(cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the default rounding mode to rnd. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_set_default_rounding_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2729 + * cmpfr.mpfr_set_default_rounding_mode(rnd) + * + * def mpfr_get_default_rounding_mode(): # <<<<<<<<<<<<<< + * """ + * Get the default rounding mode. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_305mpfr_get_default_rounding_mode(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_304mpfr_get_default_rounding_mode, "mpfr_get_default_rounding_mode()\n\n Get the default rounding mode.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_305mpfr_get_default_rounding_mode = {"mpfr_get_default_rounding_mode", (PyCFunction)__pyx_pw_4mpfr_305mpfr_get_default_rounding_mode, METH_NOARGS, __pyx_doc_4mpfr_304mpfr_get_default_rounding_mode}; +static PyObject *__pyx_pw_4mpfr_305mpfr_get_default_rounding_mode(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_default_rounding_mode (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_304mpfr_get_default_rounding_mode(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_304mpfr_get_default_rounding_mode(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_default_rounding_mode", 1); + + /* "mpfr.pyx":2734 + * + * """ + * return cmpfr.mpfr_get_default_rounding_mode() # <<<<<<<<<<<<<< + * + * def mpfr_prec_round( + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_mpfr_rnd_t(mpfr_get_default_rounding_mode()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2729 + * cmpfr.mpfr_set_default_rounding_mode(rnd) + * + * def mpfr_get_default_rounding_mode(): # <<<<<<<<<<<<<< + * """ + * Get the default rounding mode. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_get_default_rounding_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2736 + * return cmpfr.mpfr_get_default_rounding_mode() + * + * def mpfr_prec_round( # <<<<<<<<<<<<<< + * Mpfr_t x not None, cmpfr.mpfr_prec_t prec, cmpfr.mpfr_rnd_t rnd + * ): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_307mpfr_prec_round(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_306mpfr_prec_round, "mpfr_prec_round(Mpfr_t x, mpfr_prec_t prec, mpfr_rnd_t rnd)\n\n Round x according to the given rounding mode and precision.\n\n Round x according to rnd with precision prec, which must be an integer\n between MPFR_PREC_MIN and MPFR_PREC_MAX (otherwise the behavior is\n undefined). If prec is greater or equal to the precision of x, then new\n space is allocated for the significand, and it is filled with\n zeros. Otherwise, the significand is rounded to precision prec with the\n given direction. In both cases, the precision of x is changed to prec.\n\n Here is an example of how to use mpfr_prec_round to implement Newton's\n algorithm to compute the inverse of a, assuming x is already an\n approximation to n bits:\n\n mpfr_set_prec (t, 2 * n);\n mpfr_set (t, a, MPFR_RNDN); /* round a to 2n bits */\n mpfr_mul (t, t, x, MPFR_RNDN); /* t is correct to 2n bits */\n mpfr_ui_sub (t, 1, t, MPFR_RNDN); /* high n bits cancel with 1 */\n mpfr_prec_round (t, n, MPFR_RNDN); /* t is correct to n bits */\n mpfr_mul (t, t, x, MPFR_RNDN); /* t is correct to n bits */\n mpfr_prec_round (x, 2 * n, MPFR_RNDN); /* exact */\n mpfr_add (x, x, t, MPFR_RNDN); /* x is correct to 2n bits */\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_307mpfr_prec_round = {"mpfr_prec_round", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_307mpfr_prec_round, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_306mpfr_prec_round}; +static PyObject *__pyx_pw_4mpfr_307mpfr_prec_round(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + mpfr_prec_t __pyx_v_prec; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_prec_round (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_prec,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2736, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prec)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2736, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_prec_round", 1, 3, 3, 1); __PYX_ERR(1, 2736, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2736, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_prec_round", 1, 3, 3, 2); __PYX_ERR(1, 2736, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_prec_round") < 0)) __PYX_ERR(1, 2736, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_prec = __Pyx_PyInt_As_mpfr_prec_t(values[1]); if (unlikely((__pyx_v_prec == ((mpfr_prec_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 2737, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2737, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_prec_round", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2736, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_prec_round", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 2737, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_306mpfr_prec_round(__pyx_self, __pyx_v_x, __pyx_v_prec, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_306mpfr_prec_round(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, mpfr_prec_t __pyx_v_prec, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_prec_round", 1); + + /* "mpfr.pyx":2763 + * + * """ + * check_initialized(x) # <<<<<<<<<<<<<< + * check_precision(prec) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2763, __pyx_L1_error) + + /* "mpfr.pyx":2764 + * """ + * check_initialized(x) + * check_precision(prec) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_prec_round(&x._value, prec, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_precision(__pyx_v_prec); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2764, __pyx_L1_error) + + /* "mpfr.pyx":2765 + * check_initialized(x) + * check_precision(prec) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_prec_round(&x._value, prec, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2765, __pyx_L1_error) + + /* "mpfr.pyx":2766 + * check_precision(prec) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_prec_round(&x._value, prec, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_can_round(Mpfr_t b not None, cmpfr.mpfr_exp_t err, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_prec_round((&__pyx_v_x->_value), __pyx_v_prec, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2766, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2736 + * return cmpfr.mpfr_get_default_rounding_mode() + * + * def mpfr_prec_round( # <<<<<<<<<<<<<< + * Mpfr_t x not None, cmpfr.mpfr_prec_t prec, cmpfr.mpfr_rnd_t rnd + * ): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_prec_round", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2768 + * return cmpfr.mpfr_prec_round(&x._value, prec, rnd) + * + * def mpfr_can_round(Mpfr_t b not None, cmpfr.mpfr_exp_t err, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd1, cmpfr.mpfr_rnd_t rnd2, + * cmpfr.mpfr_prec_t prec): + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_309mpfr_can_round(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_308mpfr_can_round, "mpfr_can_round(Mpfr_t b, mpfr_exp_t err, mpfr_rnd_t rnd1, mpfr_rnd_t rnd2, mpfr_prec_t prec)\n\n Assuming b is an approximation of an unknown number x in the direction rnd1\n with error at most two to the power E(b)-err where E(b) is the exponent of\n b, return a non-zero value if one is able to round correctly x to precision\n prec with the direction rnd2, and 0 otherwise (including for NaN and\n Inf). This function does not modify its arguments.\n\n If rnd1 is MPFR_RNDN, then the sign of the error is unknown, but its\n absolute value is the same, so that the possible range is twice as large as\n with a directed rounding for rnd1.\n\n Note: if one wants to also determine the correct ternary value when\n rounding b to precision prec with rounding mode rnd, a useful trick is the\n following:\n\n if mpfr_can_round(b, err, MPFR_RNDN, MPFR_RNDZ, prec + (rnd == MPFR_RNDN)):\n ...\n\n Indeed, if rnd is MPFR_RNDN, this will check if one can round to prec+1\n bits with a directed rounding: if so, one can surely round to nearest to\n prec bits, and in addition one can determine the correct ternary value,\n which would not be the case when b is near from a value exactly\n representable on prec bits.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_309mpfr_can_round = {"mpfr_can_round", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_309mpfr_can_round, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_308mpfr_can_round}; +static PyObject *__pyx_pw_4mpfr_309mpfr_can_round(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_b = 0; + mpfr_exp_t __pyx_v_err; + mpfr_rnd_t __pyx_v_rnd1; + mpfr_rnd_t __pyx_v_rnd2; + mpfr_prec_t __pyx_v_prec; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[5] = {0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_can_round (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_b,&__pyx_n_s_err,&__pyx_n_s_rnd1,&__pyx_n_s_rnd2,&__pyx_n_s_prec,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2768, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_err)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2768, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_can_round", 1, 5, 5, 1); __PYX_ERR(1, 2768, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2768, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_can_round", 1, 5, 5, 2); __PYX_ERR(1, 2768, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2768, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_can_round", 1, 5, 5, 3); __PYX_ERR(1, 2768, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prec)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2768, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_can_round", 1, 5, 5, 4); __PYX_ERR(1, 2768, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_can_round") < 0)) __PYX_ERR(1, 2768, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 5)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + } + __pyx_v_b = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_err = __Pyx_PyInt_As_mp_exp_t(values[1]); if (unlikely((__pyx_v_err == ((mpfr_exp_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 2768, __pyx_L3_error) + __pyx_v_rnd1 = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2769, __pyx_L3_error) + __pyx_v_rnd2 = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2769, __pyx_L3_error) + __pyx_v_prec = __Pyx_PyInt_As_mpfr_prec_t(values[4]); if (unlikely((__pyx_v_prec == ((mpfr_prec_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 2770, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_can_round", 1, 5, 5, __pyx_nargs); __PYX_ERR(1, 2768, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_can_round", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_4mpfr_Mpfr_t, 0, "b", 0))) __PYX_ERR(1, 2768, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_308mpfr_can_round(__pyx_self, __pyx_v_b, __pyx_v_err, __pyx_v_rnd1, __pyx_v_rnd2, __pyx_v_prec); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_308mpfr_can_round(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_b, mpfr_exp_t __pyx_v_err, mpfr_rnd_t __pyx_v_rnd1, mpfr_rnd_t __pyx_v_rnd2, mpfr_prec_t __pyx_v_prec) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_can_round", 1); + + /* "mpfr.pyx":2796 + * + * """ + * check_initialized(b) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd1) + * check_rounding_mode(rnd2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_b); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2796, __pyx_L1_error) + + /* "mpfr.pyx":2797 + * """ + * check_initialized(b) + * check_rounding_mode(rnd1) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd2) + * check_precision(prec) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2797, __pyx_L1_error) + + /* "mpfr.pyx":2798 + * check_initialized(b) + * check_rounding_mode(rnd1) + * check_rounding_mode(rnd2) # <<<<<<<<<<<<<< + * check_precision(prec) + * return bool(cmpfr.mpfr_can_round(&b._value, err, rnd1, rnd2, prec)) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2798, __pyx_L1_error) + + /* "mpfr.pyx":2799 + * check_rounding_mode(rnd1) + * check_rounding_mode(rnd2) + * check_precision(prec) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_can_round(&b._value, err, rnd1, rnd2, prec)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_precision(__pyx_v_prec); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2799, __pyx_L1_error) + + /* "mpfr.pyx":2800 + * check_rounding_mode(rnd2) + * check_precision(prec) + * return bool(cmpfr.mpfr_can_round(&b._value, err, rnd1, rnd2, prec)) # <<<<<<<<<<<<<< + * + * def mpfr_min_prec(Mpfr_t x not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_can_round((&__pyx_v_b->_value), __pyx_v_err, __pyx_v_rnd1, __pyx_v_rnd2, __pyx_v_prec)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2800, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 2800, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2800, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2768 + * return cmpfr.mpfr_prec_round(&x._value, prec, rnd) + * + * def mpfr_can_round(Mpfr_t b not None, cmpfr.mpfr_exp_t err, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd1, cmpfr.mpfr_rnd_t rnd2, + * cmpfr.mpfr_prec_t prec): + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_can_round", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2802 + * return bool(cmpfr.mpfr_can_round(&b._value, err, rnd1, rnd2, prec)) + * + * def mpfr_min_prec(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Return the minimal number of bits required to store the significand of x, + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_311mpfr_min_prec(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_310mpfr_min_prec, "mpfr_min_prec(Mpfr_t x)\n\n Return the minimal number of bits required to store the significand of x,\n and 0 for special values, including 0. (Warning: the returned value can be\n less than MPFR_PREC_MIN.)\n\n The function name is subject to change.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_311mpfr_min_prec = {"mpfr_min_prec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_311mpfr_min_prec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_310mpfr_min_prec}; +static PyObject *__pyx_pw_4mpfr_311mpfr_min_prec(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_min_prec (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2802, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_min_prec") < 0)) __PYX_ERR(1, 2802, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_min_prec", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 2802, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_min_prec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 2802, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_310mpfr_min_prec(__pyx_self, __pyx_v_x); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_310mpfr_min_prec(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_min_prec", 1); + + /* "mpfr.pyx":2811 + * + * """ + * check_initialized(x) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_min_prec(&x._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2811, __pyx_L1_error) + + /* "mpfr.pyx":2812 + * """ + * check_initialized(x) + * return cmpfr.mpfr_min_prec(&x._value) # <<<<<<<<<<<<<< + * + * def mpfr_print_rnd_mode(cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_mpfr_prec_t(mpfr_min_prec((&__pyx_v_x->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2812, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2802 + * return bool(cmpfr.mpfr_can_round(&b._value, err, rnd1, rnd2, prec)) + * + * def mpfr_min_prec(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Return the minimal number of bits required to store the significand of x, + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_min_prec", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2814 + * return cmpfr.mpfr_min_prec(&x._value) + * + * def mpfr_print_rnd_mode(cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return a string ("MPFR_RNDD", "MPFR_RNDU", "MPFR_RNDN", "MPFR_RNDZ", + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_313mpfr_print_rnd_mode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_312mpfr_print_rnd_mode, "mpfr_print_rnd_mode(mpfr_rnd_t rnd)\n\n Return a string (\"MPFR_RNDD\", \"MPFR_RNDU\", \"MPFR_RNDN\", \"MPFR_RNDZ\",\n \"MPFR_RNDA\", \"MPFR_RNDF\") corresponding to the rounding mode rnd.\n\n Raise a ValueError if rnd is an invalid rounding mode.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_313mpfr_print_rnd_mode = {"mpfr_print_rnd_mode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_313mpfr_print_rnd_mode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_312mpfr_print_rnd_mode}; +static PyObject *__pyx_pw_4mpfr_313mpfr_print_rnd_mode(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_print_rnd_mode (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2814, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_print_rnd_mode") < 0)) __PYX_ERR(1, 2814, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[0])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2814, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_print_rnd_mode", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 2814, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_print_rnd_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_312mpfr_print_rnd_mode(__pyx_self, __pyx_v_rnd); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_312mpfr_print_rnd_mode(CYTHON_UNUSED PyObject *__pyx_self, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_v_rounding_mode = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_print_rnd_mode", 1); + + /* "mpfr.pyx":2823 + * """ + * cdef bytes rounding_mode + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * rounding_mode = cmpfr.mpfr_print_rnd_mode(rnd) + * if sys.version_info < (3,): + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2823, __pyx_L1_error) + + /* "mpfr.pyx":2824 + * cdef bytes rounding_mode + * check_rounding_mode(rnd) + * rounding_mode = cmpfr.mpfr_print_rnd_mode(rnd) # <<<<<<<<<<<<<< + * if sys.version_info < (3,): + * return rounding_mode + */ + __pyx_t_2 = __Pyx_PyBytes_FromString(mpfr_print_rnd_mode(__pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_rounding_mode = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "mpfr.pyx":2825 + * check_rounding_mode(rnd) + * rounding_mode = cmpfr.mpfr_print_rnd_mode(rnd) + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return rounding_mode + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2825, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2825, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_tuple__4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2825, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 2825, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + + /* "mpfr.pyx":2826 + * rounding_mode = cmpfr.mpfr_print_rnd_mode(rnd) + * if sys.version_info < (3,): + * return rounding_mode # <<<<<<<<<<<<<< + * else: + * return rounding_mode.decode('ascii') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_rounding_mode); + __pyx_r = __pyx_v_rounding_mode; + goto __pyx_L0; + + /* "mpfr.pyx":2825 + * check_rounding_mode(rnd) + * rounding_mode = cmpfr.mpfr_print_rnd_mode(rnd) + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return rounding_mode + * else: + */ + } + + /* "mpfr.pyx":2828 + * return rounding_mode + * else: + * return rounding_mode.decode('ascii') # <<<<<<<<<<<<<< + * + * ############################################################################### + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_decode_bytes(__pyx_v_rounding_mode, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2828, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "mpfr.pyx":2814 + * return cmpfr.mpfr_min_prec(&x._value) + * + * def mpfr_print_rnd_mode(cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return a string ("MPFR_RNDD", "MPFR_RNDU", "MPFR_RNDN", "MPFR_RNDZ", + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("mpfr.mpfr_print_rnd_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rounding_mode); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2834 + * ############################################################################### + * + * def mpfr_nexttoward(Mpfr_t x not None, Mpfr_t y not None): # <<<<<<<<<<<<<< + * """ + * Replace x by the next floating-point number in the direction of y. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_315mpfr_nexttoward(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_314mpfr_nexttoward, "mpfr_nexttoward(Mpfr_t x, Mpfr_t y)\n\n Replace x by the next floating-point number in the direction of y.\n\n If x or y is NaN, set x to NaN. If x and y are equal, x is\n unchanged. Otherwise, if x is different from y, replace x by the next\n floating-point number (with the precision of x and the current exponent\n range) in the direction of y (the infinite values are seen as the smallest\n and largest floating-point numbers). If the result is zero, it keeps the\n same sign. No underflow or overflow is generated.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_315mpfr_nexttoward = {"mpfr_nexttoward", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_315mpfr_nexttoward, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_314mpfr_nexttoward}; +static PyObject *__pyx_pw_4mpfr_315mpfr_nexttoward(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_nexttoward (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2834, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2834, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_nexttoward", 1, 2, 2, 1); __PYX_ERR(1, 2834, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_nexttoward") < 0)) __PYX_ERR(1, 2834, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_y = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_nexttoward", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2834, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_nexttoward", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 2834, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4mpfr_Mpfr_t, 0, "y", 0))) __PYX_ERR(1, 2834, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_314mpfr_nexttoward(__pyx_self, __pyx_v_x, __pyx_v_y); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_314mpfr_nexttoward(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_y) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_nexttoward", 1); + + /* "mpfr.pyx":2846 + * + * """ + * check_initialized(x) # <<<<<<<<<<<<<< + * check_initialized(y) + * cmpfr.mpfr_nexttoward(&x._value, &y._value) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2846, __pyx_L1_error) + + /* "mpfr.pyx":2847 + * """ + * check_initialized(x) + * check_initialized(y) # <<<<<<<<<<<<<< + * cmpfr.mpfr_nexttoward(&x._value, &y._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_y); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2847, __pyx_L1_error) + + /* "mpfr.pyx":2848 + * check_initialized(x) + * check_initialized(y) + * cmpfr.mpfr_nexttoward(&x._value, &y._value) # <<<<<<<<<<<<<< + * + * def mpfr_nextabove(Mpfr_t op not None): + */ + mpfr_nexttoward((&__pyx_v_x->_value), (&__pyx_v_y->_value)); + + /* "mpfr.pyx":2834 + * ############################################################################### + * + * def mpfr_nexttoward(Mpfr_t x not None, Mpfr_t y not None): # <<<<<<<<<<<<<< + * """ + * Replace x by the next floating-point number in the direction of y. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_nexttoward", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2850 + * cmpfr.mpfr_nexttoward(&x._value, &y._value) + * + * def mpfr_nextabove(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Equivalent to mpfr_nexttoward(op, y) where y is plus infinity. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_317mpfr_nextabove(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_316mpfr_nextabove, "mpfr_nextabove(Mpfr_t op)\n\n Equivalent to mpfr_nexttoward(op, y) where y is plus infinity.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_317mpfr_nextabove = {"mpfr_nextabove", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_317mpfr_nextabove, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_316mpfr_nextabove}; +static PyObject *__pyx_pw_4mpfr_317mpfr_nextabove(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_nextabove (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2850, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_nextabove") < 0)) __PYX_ERR(1, 2850, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_nextabove", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 2850, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_nextabove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2850, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_316mpfr_nextabove(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_316mpfr_nextabove(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_nextabove", 1); + + /* "mpfr.pyx":2855 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * cmpfr.mpfr_nextabove(&op._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2855, __pyx_L1_error) + + /* "mpfr.pyx":2856 + * """ + * check_initialized(op) + * cmpfr.mpfr_nextabove(&op._value) # <<<<<<<<<<<<<< + * + * def mpfr_nextbelow(Mpfr_t op not None): + */ + mpfr_nextabove((&__pyx_v_op->_value)); + + /* "mpfr.pyx":2850 + * cmpfr.mpfr_nexttoward(&x._value, &y._value) + * + * def mpfr_nextabove(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Equivalent to mpfr_nexttoward(op, y) where y is plus infinity. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_nextabove", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2858 + * cmpfr.mpfr_nextabove(&op._value) + * + * def mpfr_nextbelow(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Equivalent to mpfr_nexttoward(op, y) where y is minus infinity. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_319mpfr_nextbelow(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_318mpfr_nextbelow, "mpfr_nextbelow(Mpfr_t op)\n\n Equivalent to mpfr_nexttoward(op, y) where y is minus infinity.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_319mpfr_nextbelow = {"mpfr_nextbelow", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_319mpfr_nextbelow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_318mpfr_nextbelow}; +static PyObject *__pyx_pw_4mpfr_319mpfr_nextbelow(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_nextbelow (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2858, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_nextbelow") < 0)) __PYX_ERR(1, 2858, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_nextbelow", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 2858, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_nextbelow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2858, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_318mpfr_nextbelow(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_318mpfr_nextbelow(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_nextbelow", 1); + + /* "mpfr.pyx":2863 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * cmpfr.mpfr_nextbelow(&op._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2863, __pyx_L1_error) + + /* "mpfr.pyx":2864 + * """ + * check_initialized(op) + * cmpfr.mpfr_nextbelow(&op._value) # <<<<<<<<<<<<<< + * + * def mpfr_min(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, + */ + mpfr_nextbelow((&__pyx_v_op->_value)); + + /* "mpfr.pyx":2858 + * cmpfr.mpfr_nextabove(&op._value) + * + * def mpfr_nextbelow(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Equivalent to mpfr_nexttoward(op, y) where y is minus infinity. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_nextbelow", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2866 + * cmpfr.mpfr_nextbelow(&op._value) + * + * def mpfr_min(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_321mpfr_min(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_320mpfr_min, "mpfr_min(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to the minimum of op1 and op2.\n\n If op1 and op2 are both NaN, then rop is set to NaN. If op1 or op2 is NaN,\n then rop is set to the numeric value. If op1 and op2 are zeros of different\n signs, then rop is set to \342\210\2220.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_321mpfr_min = {"mpfr_min", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_321mpfr_min, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_320mpfr_min}; +static PyObject *__pyx_pw_4mpfr_321mpfr_min(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_min (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2866, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2866, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_min", 1, 4, 4, 1); __PYX_ERR(1, 2866, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2866, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_min", 1, 4, 4, 2); __PYX_ERR(1, 2866, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2866, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_min", 1, 4, 4, 3); __PYX_ERR(1, 2866, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_min") < 0)) __PYX_ERR(1, 2866, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2867, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_min", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2866, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_min", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2866, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 2866, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 2866, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_320mpfr_min(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_320mpfr_min(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_min", 1); + + /* "mpfr.pyx":2876 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2876, __pyx_L1_error) + + /* "mpfr.pyx":2877 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2877, __pyx_L1_error) + + /* "mpfr.pyx":2878 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_min(&rop._value, &op1._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2878, __pyx_L1_error) + + /* "mpfr.pyx":2879 + * check_initialized(op1) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_min(&rop._value, &op1._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2879, __pyx_L1_error) + + /* "mpfr.pyx":2880 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_min(&rop._value, &op1._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_max(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_min((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2866 + * cmpfr.mpfr_nextbelow(&op._value) + * + * def mpfr_min(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_min", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2882 + * return cmpfr.mpfr_min(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_max(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_323mpfr_max(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_322mpfr_max, "mpfr_max(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to the maximum of op1 and op2.\n\n If op1 and op2 are both NaN, then rop is set to NaN. If op1 or op2 is NaN,\n then rop is set to the numeric value. If op1 and op2 are zeros of different\n signs, then rop is set to +0.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_323mpfr_max = {"mpfr_max", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_323mpfr_max, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_322mpfr_max}; +static PyObject *__pyx_pw_4mpfr_323mpfr_max(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_max (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2882, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2882, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_max", 1, 4, 4, 1); __PYX_ERR(1, 2882, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2882, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_max", 1, 4, 4, 2); __PYX_ERR(1, 2882, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2882, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_max", 1, 4, 4, 3); __PYX_ERR(1, 2882, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_max") < 0)) __PYX_ERR(1, 2882, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2883, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_max", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2882, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_max", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2882, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 2882, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 2882, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_322mpfr_max(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_322mpfr_max(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_max", 1); + + /* "mpfr.pyx":2892 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2892, __pyx_L1_error) + + /* "mpfr.pyx":2893 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2893, __pyx_L1_error) + + /* "mpfr.pyx":2894 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_max(&rop._value, &op1._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2894, __pyx_L1_error) + + /* "mpfr.pyx":2895 + * check_initialized(op1) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_max(&rop._value, &op1._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2895, __pyx_L1_error) + + /* "mpfr.pyx":2896 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_max(&rop._value, &op1._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_get_exp(Mpfr_t op not None): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_max((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2896, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2882 + * return cmpfr.mpfr_min(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_max(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_max", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2898 + * return cmpfr.mpfr_max(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_get_exp(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return the exponent of op. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_325mpfr_get_exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_324mpfr_get_exp, "mpfr_get_exp(Mpfr_t op)\n\n Return the exponent of op.\n\n Return the exponent of op, assuming that op is a non-zero ordinary number\n and the significand is considered in [1/2, 1). The behavior for NaN,\n infinity or zero is undefined.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_325mpfr_get_exp = {"mpfr_get_exp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_325mpfr_get_exp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_324mpfr_get_exp}; +static PyObject *__pyx_pw_4mpfr_325mpfr_get_exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_exp (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2898, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_get_exp") < 0)) __PYX_ERR(1, 2898, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_get_exp", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 2898, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_get_exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2898, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_324mpfr_get_exp(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_324mpfr_get_exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_exp", 1); + + /* "mpfr.pyx":2907 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_get_exp(&op._value) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2907, __pyx_L1_error) + + /* "mpfr.pyx":2908 + * """ + * check_initialized(op) + * return cmpfr.mpfr_get_exp(&op._value) # <<<<<<<<<<<<<< + * + * def mpfr_set_exp(Mpfr_t op not None, cmpfr.mpfr_exp_t exp): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_mp_exp_t(mpfr_get_exp((&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2908, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2898 + * return cmpfr.mpfr_max(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_get_exp(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return the exponent of op. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_get_exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2910 + * return cmpfr.mpfr_get_exp(&op._value) + * + * def mpfr_set_exp(Mpfr_t op not None, cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the exponent of op. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_327mpfr_set_exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_326mpfr_set_exp, "mpfr_set_exp(Mpfr_t op, mpfr_exp_t exp)\n\n Set the exponent of op.\n\n Set the exponent of op to exp if exp is in the current exponent range (even\n if x is not a non-zero ordinary number). If exp is not in the current\n exponent range, raise ValueError. The significand is assumed to be in\n [1/2, 1).\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_327mpfr_set_exp = {"mpfr_set_exp", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_327mpfr_set_exp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_326mpfr_set_exp}; +static PyObject *__pyx_pw_4mpfr_327mpfr_set_exp(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + mpfr_exp_t __pyx_v_exp; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_exp (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,&__pyx_n_s_exp,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2910, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exp)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2910, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_set_exp", 1, 2, 2, 1); __PYX_ERR(1, 2910, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_exp") < 0)) __PYX_ERR(1, 2910, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_exp = __Pyx_PyInt_As_mp_exp_t(values[1]); if (unlikely((__pyx_v_exp == ((mpfr_exp_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 2910, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_exp", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 2910, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2910, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_326mpfr_set_exp(__pyx_self, __pyx_v_op, __pyx_v_exp); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_326mpfr_set_exp(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, mpfr_exp_t __pyx_v_exp) { + int __pyx_v_error_code; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_exp", 1); + + /* "mpfr.pyx":2920 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * error_code = cmpfr.mpfr_set_exp(&op._value, exp) + * if error_code: + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2920, __pyx_L1_error) + + /* "mpfr.pyx":2921 + * """ + * check_initialized(op) + * error_code = cmpfr.mpfr_set_exp(&op._value, exp) # <<<<<<<<<<<<<< + * if error_code: + * raise ValueError("exponent not in current exponent range") + */ + __pyx_v_error_code = mpfr_set_exp((&__pyx_v_op->_value), __pyx_v_exp); + + /* "mpfr.pyx":2922 + * check_initialized(op) + * error_code = cmpfr.mpfr_set_exp(&op._value, exp) + * if error_code: # <<<<<<<<<<<<<< + * raise ValueError("exponent not in current exponent range") + * + */ + __pyx_t_2 = (__pyx_v_error_code != 0); + if (unlikely(__pyx_t_2)) { + + /* "mpfr.pyx":2923 + * error_code = cmpfr.mpfr_set_exp(&op._value, exp) + * if error_code: + * raise ValueError("exponent not in current exponent range") # <<<<<<<<<<<<<< + * + * def mpfr_signbit(Mpfr_t op not None): + */ + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __PYX_ERR(1, 2923, __pyx_L1_error) + + /* "mpfr.pyx":2922 + * check_initialized(op) + * error_code = cmpfr.mpfr_set_exp(&op._value, exp) + * if error_code: # <<<<<<<<<<<<<< + * raise ValueError("exponent not in current exponent range") + * + */ + } + + /* "mpfr.pyx":2910 + * return cmpfr.mpfr_get_exp(&op._value) + * + * def mpfr_set_exp(Mpfr_t op not None, cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the exponent of op. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("mpfr.mpfr_set_exp", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2925 + * raise ValueError("exponent not in current exponent range") + * + * def mpfr_signbit(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op has its sign bit set. Return False otherwise. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_329mpfr_signbit(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_328mpfr_signbit, "mpfr_signbit(Mpfr_t op)\n\n Return True if op has its sign bit set. Return False otherwise.\n\n This function returns True for negative numbers, negative infinity, -0,\n or a NaN whose representation has its sign bit set.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_329mpfr_signbit = {"mpfr_signbit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_329mpfr_signbit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_328mpfr_signbit}; +static PyObject *__pyx_pw_4mpfr_329mpfr_signbit(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_signbit (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2925, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_signbit") < 0)) __PYX_ERR(1, 2925, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_signbit", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 2925, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_signbit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2925, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_328mpfr_signbit(__pyx_self, __pyx_v_op); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_328mpfr_signbit(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_signbit", 1); + + /* "mpfr.pyx":2933 + * + * """ + * check_initialized(op) # <<<<<<<<<<<<<< + * return bool(cmpfr.mpfr_signbit(&op._value)) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2933, __pyx_L1_error) + + /* "mpfr.pyx":2934 + * """ + * check_initialized(op) + * return bool(cmpfr.mpfr_signbit(&op._value)) # <<<<<<<<<<<<<< + * + * def mpfr_setsign(Mpfr_t rop not None, Mpfr_t op not None, s, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_signbit((&__pyx_v_op->_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 2934, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2934, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2925 + * raise ValueError("exponent not in current exponent range") + * + * def mpfr_signbit(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op has its sign bit set. Return False otherwise. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_signbit", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2936 + * return bool(cmpfr.mpfr_signbit(&op._value)) + * + * def mpfr_setsign(Mpfr_t rop not None, Mpfr_t op not None, s, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from op and the sign of rop from s. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_331mpfr_setsign(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_330mpfr_setsign, "mpfr_setsign(Mpfr_t rop, Mpfr_t op, s, mpfr_rnd_t rnd)\n\n Set the value of rop from op and the sign of rop from s.\n\n Set the value of rop from op, rounded toward the given direction rnd, then\n set (resp. clear) its sign bit if s is non-zero (resp. zero), even when op\n is a NaN.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_331mpfr_setsign = {"mpfr_setsign", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_331mpfr_setsign, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_330mpfr_setsign}; +static PyObject *__pyx_pw_4mpfr_331mpfr_setsign(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op = 0; + PyObject *__pyx_v_s = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_setsign (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op,&__pyx_n_s_s,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2936, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2936, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_setsign", 1, 4, 4, 1); __PYX_ERR(1, 2936, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_s)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2936, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_setsign", 1, 4, 4, 2); __PYX_ERR(1, 2936, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2936, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_setsign", 1, 4, 4, 3); __PYX_ERR(1, 2936, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_setsign") < 0)) __PYX_ERR(1, 2936, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_s = values[2]; + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2936, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_setsign", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2936, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_setsign", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2936, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op), __pyx_ptype_4mpfr_Mpfr_t, 0, "op", 0))) __PYX_ERR(1, 2936, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_330mpfr_setsign(__pyx_self, __pyx_v_rop, __pyx_v_op, __pyx_v_s, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_330mpfr_setsign(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op, PyObject *__pyx_v_s, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_setsign", 1); + + /* "mpfr.pyx":2945 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2945, __pyx_L1_error) + + /* "mpfr.pyx":2946 + * """ + * check_initialized(rop) + * check_initialized(op) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_setsign(&rop._value, &op._value, s, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2946, __pyx_L1_error) + + /* "mpfr.pyx":2947 + * check_initialized(rop) + * check_initialized(op) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_setsign(&rop._value, &op._value, s, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2947, __pyx_L1_error) + + /* "mpfr.pyx":2948 + * check_initialized(op) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_setsign(&rop._value, &op._value, s, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_copysign(Mpfr_t rop not None, Mpfr_t op1 not None, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_s); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 2948, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_setsign((&__pyx_v_rop->_value), (&__pyx_v_op->_value), __pyx_t_1, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2936 + * return bool(cmpfr.mpfr_signbit(&op._value)) + * + * def mpfr_setsign(Mpfr_t rop not None, Mpfr_t op not None, s, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from op and the sign of rop from s. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_setsign", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2950 + * return cmpfr.mpfr_setsign(&rop._value, &op._value, s, rnd) + * + * def mpfr_copysign(Mpfr_t rop not None, Mpfr_t op1 not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_333mpfr_copysign(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_332mpfr_copysign, "mpfr_copysign(Mpfr_t rop, Mpfr_t op1, Mpfr_t op2, mpfr_rnd_t rnd)\n\n Set rop to op1 with the sign of op2.\n\n Set the value of rop from op1, rounded toward the given direction rnd, then\n set its sign bit to that of op2 (even when op1 or op2 is a NaN). This\n function is equivalent to mpfr_setsign (rop, op1, mpfr_signbit (op2), rnd).\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_333mpfr_copysign = {"mpfr_copysign", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_333mpfr_copysign, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_332mpfr_copysign}; +static PyObject *__pyx_pw_4mpfr_333mpfr_copysign(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1 = 0; + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2 = 0; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[4] = {0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_copysign (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rop,&__pyx_n_s_op1,&__pyx_n_s_op2,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rop)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2950, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op1)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2950, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_copysign", 1, 4, 4, 1); __PYX_ERR(1, 2950, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_op2)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2950, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_copysign", 1, 4, 4, 2); __PYX_ERR(1, 2950, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2950, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_copysign", 1, 4, 4, 3); __PYX_ERR(1, 2950, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_copysign") < 0)) __PYX_ERR(1, 2950, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 4)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + } + __pyx_v_rop = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_op1 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[1]); + __pyx_v_op2 = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[2]); + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[3])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2951, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_copysign", 1, 4, 4, __pyx_nargs); __PYX_ERR(1, 2950, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_copysign", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rop), __pyx_ptype_4mpfr_Mpfr_t, 0, "rop", 0))) __PYX_ERR(1, 2950, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op1), __pyx_ptype_4mpfr_Mpfr_t, 0, "op1", 0))) __PYX_ERR(1, 2950, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_op2), __pyx_ptype_4mpfr_Mpfr_t, 0, "op2", 0))) __PYX_ERR(1, 2951, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_332mpfr_copysign(__pyx_self, __pyx_v_rop, __pyx_v_op1, __pyx_v_op2, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_332mpfr_copysign(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_rop, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op1, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_op2, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_copysign", 1); + + /* "mpfr.pyx":2960 + * + * """ + * check_initialized(rop) # <<<<<<<<<<<<<< + * check_initialized(op1) + * check_initialized(op2) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_rop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2960, __pyx_L1_error) + + /* "mpfr.pyx":2961 + * """ + * check_initialized(rop) + * check_initialized(op1) # <<<<<<<<<<<<<< + * check_initialized(op2) + * check_rounding_mode(rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2961, __pyx_L1_error) + + /* "mpfr.pyx":2962 + * check_initialized(rop) + * check_initialized(op1) + * check_initialized(op2) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_copysign(&rop._value, &op1._value, &op2._value, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_op2); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2962, __pyx_L1_error) + + /* "mpfr.pyx":2963 + * check_initialized(op1) + * check_initialized(op2) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_copysign(&rop._value, &op1._value, &op2._value, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 2963, __pyx_L1_error) + + /* "mpfr.pyx":2964 + * check_initialized(op2) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_copysign(&rop._value, &op1._value, &op2._value, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_get_version(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_copysign((&__pyx_v_rop->_value), (&__pyx_v_op1->_value), (&__pyx_v_op2->_value), __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2964, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2950 + * return cmpfr.mpfr_setsign(&rop._value, &op._value, s, rnd) + * + * def mpfr_copysign(Mpfr_t rop not None, Mpfr_t op1 not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_copysign", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2966 + * return cmpfr.mpfr_copysign(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_get_version(): # <<<<<<<<<<<<<< + * """ + * Return the MPFR version, as a string. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_335mpfr_get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_334mpfr_get_version, "mpfr_get_version()\n\n Return the MPFR version, as a string.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_335mpfr_get_version = {"mpfr_get_version", (PyCFunction)__pyx_pw_4mpfr_335mpfr_get_version, METH_NOARGS, __pyx_doc_4mpfr_334mpfr_get_version}; +static PyObject *__pyx_pw_4mpfr_335mpfr_get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_version (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_334mpfr_get_version(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_334mpfr_get_version(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_v_version = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_version", 1); + + /* "mpfr.pyx":2971 + * + * """ + * cdef bytes version = cmpfr.mpfr_get_version() # <<<<<<<<<<<<<< + * if sys.version_info < (3,): + * return version + */ + __pyx_t_1 = __Pyx_PyBytes_FromString(mpfr_get_version()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2971, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_version = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "mpfr.pyx":2972 + * """ + * cdef bytes version = cmpfr.mpfr_get_version() + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return version + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 2972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2972, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 2972, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "mpfr.pyx":2973 + * cdef bytes version = cmpfr.mpfr_get_version() + * if sys.version_info < (3,): + * return version # <<<<<<<<<<<<<< + * else: + * return version.decode('ascii') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_version); + __pyx_r = __pyx_v_version; + goto __pyx_L0; + + /* "mpfr.pyx":2972 + * """ + * cdef bytes version = cmpfr.mpfr_get_version() + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return version + * else: + */ + } + + /* "mpfr.pyx":2975 + * return version + * else: + * return version.decode('ascii') # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_decode_bytes(__pyx_v_version, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2975, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "mpfr.pyx":2966 + * return cmpfr.mpfr_copysign(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_get_version(): # <<<<<<<<<<<<<< + * """ + * Return the MPFR version, as a string. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_get_version", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_version); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2987 + * MPFR_VERSION_STRING = cmpfr.MPFR_VERSION_STRING.decode('ascii') + * + * def MPFR_VERSION_NUM(int major, int minor, int patchlevel): # <<<<<<<<<<<<<< + * """ + * Create an integer in the same format as used by MPFR_VERSION from the given + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_337MPFR_VERSION_NUM(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_336MPFR_VERSION_NUM, "MPFR_VERSION_NUM(int major, int minor, int patchlevel)\n\n Create an integer in the same format as used by MPFR_VERSION from the given\n major, minor and patchlevel.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_337MPFR_VERSION_NUM = {"MPFR_VERSION_NUM", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_337MPFR_VERSION_NUM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_336MPFR_VERSION_NUM}; +static PyObject *__pyx_pw_4mpfr_337MPFR_VERSION_NUM(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + int __pyx_v_major; + int __pyx_v_minor; + int __pyx_v_patchlevel; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("MPFR_VERSION_NUM (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_major,&__pyx_n_s_minor,&__pyx_n_s_patchlevel,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_major)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2987, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_minor)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2987, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("MPFR_VERSION_NUM", 1, 3, 3, 1); __PYX_ERR(1, 2987, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_patchlevel)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2987, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("MPFR_VERSION_NUM", 1, 3, 3, 2); __PYX_ERR(1, 2987, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "MPFR_VERSION_NUM") < 0)) __PYX_ERR(1, 2987, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_major = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_major == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 2987, __pyx_L3_error) + __pyx_v_minor = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_minor == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 2987, __pyx_L3_error) + __pyx_v_patchlevel = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_patchlevel == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 2987, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("MPFR_VERSION_NUM", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 2987, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.MPFR_VERSION_NUM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_336MPFR_VERSION_NUM(__pyx_self, __pyx_v_major, __pyx_v_minor, __pyx_v_patchlevel); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_336MPFR_VERSION_NUM(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_major, int __pyx_v_minor, int __pyx_v_patchlevel) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("MPFR_VERSION_NUM", 1); + + /* "mpfr.pyx":2993 + * + * """ + * return cmpfr.MPFR_VERSION_NUM(major, minor, patchlevel) # <<<<<<<<<<<<<< + * + * def mpfr_get_patches(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(MPFR_VERSION_NUM(__pyx_v_major, __pyx_v_minor, __pyx_v_patchlevel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2993, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":2987 + * MPFR_VERSION_STRING = cmpfr.MPFR_VERSION_STRING.decode('ascii') + * + * def MPFR_VERSION_NUM(int major, int minor, int patchlevel): # <<<<<<<<<<<<<< + * """ + * Create an integer in the same format as used by MPFR_VERSION from the given + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.MPFR_VERSION_NUM", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":2995 + * return cmpfr.MPFR_VERSION_NUM(major, minor, patchlevel) + * + * def mpfr_get_patches(): # <<<<<<<<<<<<<< + * """ + * Return information about patches applied to the MPFR library. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_339mpfr_get_patches(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_338mpfr_get_patches, "mpfr_get_patches()\n\n Return information about patches applied to the MPFR library.\n\n Return a list containing the ids of patches applied to the MPFR\n library (contents of the PATCHES file), separated by spaces.\n\n Note: If the program has been compiled with an older MPFR version and is\n dynamically linked with a new MPFR library version, the identifiers of the\n patches applied to the old (compile-time) MPFR version are not available\n (however this information should not have much interest in general).\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_339mpfr_get_patches = {"mpfr_get_patches", (PyCFunction)__pyx_pw_4mpfr_339mpfr_get_patches, METH_NOARGS, __pyx_doc_4mpfr_338mpfr_get_patches}; +static PyObject *__pyx_pw_4mpfr_339mpfr_get_patches(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_patches (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_338mpfr_get_patches(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_338mpfr_get_patches(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_v_patches = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_patches", 1); + + /* "mpfr.pyx":3008 + * + * """ + * cdef bytes patches = cmpfr.mpfr_get_patches() # <<<<<<<<<<<<<< + * if sys.version_info < (3,): + * return patches.split() + */ + __pyx_t_1 = __Pyx_PyBytes_FromString(mpfr_get_patches()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_patches = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "mpfr.pyx":3009 + * """ + * cdef bytes patches = cmpfr.mpfr_get_patches() + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return patches.split() + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3009, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 3009, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "mpfr.pyx":3010 + * cdef bytes patches = cmpfr.mpfr_get_patches() + * if sys.version_info < (3,): + * return patches.split() # <<<<<<<<<<<<<< + * else: + * return patches.decode('ascii').split() + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyBytes_Type_split, __pyx_v_patches); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3010, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3009 + * """ + * cdef bytes patches = cmpfr.mpfr_get_patches() + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return patches.split() + * else: + */ + } + + /* "mpfr.pyx":3012 + * return patches.split() + * else: + * return patches.decode('ascii').split() # <<<<<<<<<<<<<< + * + * def mpfr_buildopt_tls_p(): + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_decode_bytes(__pyx_v_patches, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyUnicode_Split(((PyObject*)__pyx_t_1), ((PyObject *)NULL), -1L); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3012, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } + + /* "mpfr.pyx":2995 + * return cmpfr.MPFR_VERSION_NUM(major, minor, patchlevel) + * + * def mpfr_get_patches(): # <<<<<<<<<<<<<< + * """ + * Return information about patches applied to the MPFR library. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_get_patches", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_patches); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3014 + * return patches.decode('ascii').split() + * + * def mpfr_buildopt_tls_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled as thread safe using compiler-level Thread + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_341mpfr_buildopt_tls_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_340mpfr_buildopt_tls_p, "mpfr_buildopt_tls_p()\n\n Return True if MPFR was compiled as thread safe using compiler-level Thread\n Local Storage (that is, MPFR was built with the --enable-thread-safe\n configure option, see INSTALL file), return False otherwise.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_341mpfr_buildopt_tls_p = {"mpfr_buildopt_tls_p", (PyCFunction)__pyx_pw_4mpfr_341mpfr_buildopt_tls_p, METH_NOARGS, __pyx_doc_4mpfr_340mpfr_buildopt_tls_p}; +static PyObject *__pyx_pw_4mpfr_341mpfr_buildopt_tls_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_buildopt_tls_p (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_340mpfr_buildopt_tls_p(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_340mpfr_buildopt_tls_p(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_buildopt_tls_p", 1); + + /* "mpfr.pyx":3021 + * + * """ + * return bool(cmpfr.mpfr_buildopt_tls_p()) # <<<<<<<<<<<<<< + * + * def mpfr_buildopt_float128_p(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_buildopt_tls_p()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 3021, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3021, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3014 + * return patches.decode('ascii').split() + * + * def mpfr_buildopt_tls_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled as thread safe using compiler-level Thread + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_buildopt_tls_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3023 + * return bool(cmpfr.mpfr_buildopt_tls_p()) + * + * def mpfr_buildopt_float128_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with '__float128' support (that is, MPFR + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_343mpfr_buildopt_float128_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_342mpfr_buildopt_float128_p, "mpfr_buildopt_float128_p()\n\n Return True if MPFR was compiled with '__float128' support (that is, MPFR\n was built with the --enable-float128 configure option), return False\n otherwise.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_343mpfr_buildopt_float128_p = {"mpfr_buildopt_float128_p", (PyCFunction)__pyx_pw_4mpfr_343mpfr_buildopt_float128_p, METH_NOARGS, __pyx_doc_4mpfr_342mpfr_buildopt_float128_p}; +static PyObject *__pyx_pw_4mpfr_343mpfr_buildopt_float128_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_buildopt_float128_p (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_342mpfr_buildopt_float128_p(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_342mpfr_buildopt_float128_p(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_buildopt_float128_p", 1); + + /* "mpfr.pyx":3030 + * + * """ + * return bool(cmpfr.mpfr_buildopt_float128_p()) # <<<<<<<<<<<<<< + * + * def mpfr_buildopt_decimal_p(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_buildopt_float128_p()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 3030, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3023 + * return bool(cmpfr.mpfr_buildopt_tls_p()) + * + * def mpfr_buildopt_float128_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with '__float128' support (that is, MPFR + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_buildopt_float128_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3032 + * return bool(cmpfr.mpfr_buildopt_float128_p()) + * + * def mpfr_buildopt_decimal_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with decimal float support (that is, MPFR + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_345mpfr_buildopt_decimal_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_344mpfr_buildopt_decimal_p, "mpfr_buildopt_decimal_p()\n\n Return True if MPFR was compiled with decimal float support (that is, MPFR\n was built with the --enable-decimal-float configure option), return False\n otherwise.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_345mpfr_buildopt_decimal_p = {"mpfr_buildopt_decimal_p", (PyCFunction)__pyx_pw_4mpfr_345mpfr_buildopt_decimal_p, METH_NOARGS, __pyx_doc_4mpfr_344mpfr_buildopt_decimal_p}; +static PyObject *__pyx_pw_4mpfr_345mpfr_buildopt_decimal_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_buildopt_decimal_p (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_344mpfr_buildopt_decimal_p(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_344mpfr_buildopt_decimal_p(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_buildopt_decimal_p", 1); + + /* "mpfr.pyx":3039 + * + * """ + * return bool(cmpfr.mpfr_buildopt_decimal_p()) # <<<<<<<<<<<<<< + * + * def mpfr_buildopt_gmpinternals_p(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_buildopt_decimal_p()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 3039, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3032 + * return bool(cmpfr.mpfr_buildopt_float128_p()) + * + * def mpfr_buildopt_decimal_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with decimal float support (that is, MPFR + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_buildopt_decimal_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3041 + * return bool(cmpfr.mpfr_buildopt_decimal_p()) + * + * def mpfr_buildopt_gmpinternals_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with GMP internals (that is, MPFR was + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_347mpfr_buildopt_gmpinternals_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_346mpfr_buildopt_gmpinternals_p, "mpfr_buildopt_gmpinternals_p()\n\n Return True if MPFR was compiled with GMP internals (that is, MPFR was\n built with either --with-gmp-build or --enable-gmp-internals configure\n option), return False otherwise.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_347mpfr_buildopt_gmpinternals_p = {"mpfr_buildopt_gmpinternals_p", (PyCFunction)__pyx_pw_4mpfr_347mpfr_buildopt_gmpinternals_p, METH_NOARGS, __pyx_doc_4mpfr_346mpfr_buildopt_gmpinternals_p}; +static PyObject *__pyx_pw_4mpfr_347mpfr_buildopt_gmpinternals_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_buildopt_gmpinternals_p (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_346mpfr_buildopt_gmpinternals_p(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_346mpfr_buildopt_gmpinternals_p(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_buildopt_gmpinternals_p", 1); + + /* "mpfr.pyx":3048 + * + * """ + * return bool(cmpfr.mpfr_buildopt_gmpinternals_p()) # <<<<<<<<<<<<<< + * + * def mpfr_buildopt_sharedcache_p(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_buildopt_gmpinternals_p()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 3048, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3041 + * return bool(cmpfr.mpfr_buildopt_decimal_p()) + * + * def mpfr_buildopt_gmpinternals_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with GMP internals (that is, MPFR was + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_buildopt_gmpinternals_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3050 + * return bool(cmpfr.mpfr_buildopt_gmpinternals_p()) + * + * def mpfr_buildopt_sharedcache_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled so that all threads share the same cache + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_349mpfr_buildopt_sharedcache_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_348mpfr_buildopt_sharedcache_p, "mpfr_buildopt_sharedcache_p()\n\n Return True if MPFR was compiled so that all threads share the same cache\n for one MPFR constant, like mpfr_const_pi or mpfr_const_log2 (that is, MPFR\n was built with the \342\200\230--enable-shared-cache\342\200\231 configure option), return False\n otherwise. If the return value is True, MPFR applications may need to\n be compiled with the \342\200\230-pthread\342\200\231 option.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_349mpfr_buildopt_sharedcache_p = {"mpfr_buildopt_sharedcache_p", (PyCFunction)__pyx_pw_4mpfr_349mpfr_buildopt_sharedcache_p, METH_NOARGS, __pyx_doc_4mpfr_348mpfr_buildopt_sharedcache_p}; +static PyObject *__pyx_pw_4mpfr_349mpfr_buildopt_sharedcache_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_buildopt_sharedcache_p (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_348mpfr_buildopt_sharedcache_p(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_348mpfr_buildopt_sharedcache_p(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_buildopt_sharedcache_p", 1); + + /* "mpfr.pyx":3059 + * + * """ + * return bool(cmpfr.mpfr_buildopt_sharedcache_p()) # <<<<<<<<<<<<<< + * + * def mpfr_buildopt_tune_case(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_buildopt_sharedcache_p()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 3059, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3050 + * return bool(cmpfr.mpfr_buildopt_gmpinternals_p()) + * + * def mpfr_buildopt_sharedcache_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled so that all threads share the same cache + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_buildopt_sharedcache_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3061 + * return bool(cmpfr.mpfr_buildopt_sharedcache_p()) + * + * def mpfr_buildopt_tune_case(): # <<<<<<<<<<<<<< + * """ + * Return a string saying which thresholds file has been used at compile + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_351mpfr_buildopt_tune_case(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_350mpfr_buildopt_tune_case, "mpfr_buildopt_tune_case()\n\n Return a string saying which thresholds file has been used at compile\n time. This file is normally selected from the processor type.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_351mpfr_buildopt_tune_case = {"mpfr_buildopt_tune_case", (PyCFunction)__pyx_pw_4mpfr_351mpfr_buildopt_tune_case, METH_NOARGS, __pyx_doc_4mpfr_350mpfr_buildopt_tune_case}; +static PyObject *__pyx_pw_4mpfr_351mpfr_buildopt_tune_case(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_buildopt_tune_case (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_350mpfr_buildopt_tune_case(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_350mpfr_buildopt_tune_case(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_v_thresholds = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_buildopt_tune_case", 1); + + /* "mpfr.pyx":3067 + * + * """ + * cdef bytes thresholds = cmpfr.mpfr_buildopt_tune_case() # <<<<<<<<<<<<<< + * if sys.version_info < (3,): + * return thresholds + */ + __pyx_t_1 = __Pyx_PyBytes_FromString(mpfr_buildopt_tune_case()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_thresholds = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "mpfr.pyx":3068 + * """ + * cdef bytes thresholds = cmpfr.mpfr_buildopt_tune_case() + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return thresholds + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3068, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 3068, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_3) { + + /* "mpfr.pyx":3069 + * cdef bytes thresholds = cmpfr.mpfr_buildopt_tune_case() + * if sys.version_info < (3,): + * return thresholds # <<<<<<<<<<<<<< + * else: + * return thresholds.decode('ascii') + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_thresholds); + __pyx_r = __pyx_v_thresholds; + goto __pyx_L0; + + /* "mpfr.pyx":3068 + * """ + * cdef bytes thresholds = cmpfr.mpfr_buildopt_tune_case() + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return thresholds + * else: + */ + } + + /* "mpfr.pyx":3071 + * return thresholds + * else: + * return thresholds.decode('ascii') # <<<<<<<<<<<<<< + * + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_decode_bytes(__pyx_v_thresholds, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3071, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + } + + /* "mpfr.pyx":3061 + * return bool(cmpfr.mpfr_buildopt_sharedcache_p()) + * + * def mpfr_buildopt_tune_case(): # <<<<<<<<<<<<<< + * """ + * Return a string saying which thresholds file has been used at compile + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_buildopt_tune_case", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_thresholds); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3079 + * + * + * def mpfr_get_emin(): # <<<<<<<<<<<<<< + * """ + * Return smallest exponent allowed. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_353mpfr_get_emin(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_352mpfr_get_emin, "mpfr_get_emin()\n\n Return smallest exponent allowed.\n\n Return the (current) smallest and exponent allowed for a floating-point\n variable. The smallest positive value of a floating-point variable is one\n half times 2 raised to the smallest exponent.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_353mpfr_get_emin = {"mpfr_get_emin", (PyCFunction)__pyx_pw_4mpfr_353mpfr_get_emin, METH_NOARGS, __pyx_doc_4mpfr_352mpfr_get_emin}; +static PyObject *__pyx_pw_4mpfr_353mpfr_get_emin(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_emin (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_352mpfr_get_emin(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_352mpfr_get_emin(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_emin", 1); + + /* "mpfr.pyx":3088 + * + * """ + * return cmpfr.mpfr_get_emin() # <<<<<<<<<<<<<< + * + * def mpfr_get_emax(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_mp_exp_t(mpfr_get_emin()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3079 + * + * + * def mpfr_get_emin(): # <<<<<<<<<<<<<< + * """ + * Return smallest exponent allowed. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_get_emin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3090 + * return cmpfr.mpfr_get_emin() + * + * def mpfr_get_emax(): # <<<<<<<<<<<<<< + * """ + * Return largest exponent allowed. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_355mpfr_get_emax(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_354mpfr_get_emax, "mpfr_get_emax()\n\n Return largest exponent allowed.\n\n Return the (current) largest exponent allowed for a floating-point\n variable. The largest positive value of a floating-point variable has the\n form (1 - epsilon) times 2 raised to the largest exponent, where epsilon\n depends on the precision of the considered variable.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_355mpfr_get_emax = {"mpfr_get_emax", (PyCFunction)__pyx_pw_4mpfr_355mpfr_get_emax, METH_NOARGS, __pyx_doc_4mpfr_354mpfr_get_emax}; +static PyObject *__pyx_pw_4mpfr_355mpfr_get_emax(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_emax (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_354mpfr_get_emax(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_354mpfr_get_emax(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_emax", 1); + + /* "mpfr.pyx":3100 + * + * """ + * return cmpfr.mpfr_get_emax() # <<<<<<<<<<<<<< + * + * def mpfr_set_emin(cmpfr.mpfr_exp_t exp): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_mp_exp_t(mpfr_get_emax()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3090 + * return cmpfr.mpfr_get_emin() + * + * def mpfr_get_emax(): # <<<<<<<<<<<<<< + * """ + * Return largest exponent allowed. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_get_emax", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3102 + * return cmpfr.mpfr_get_emax() + * + * def mpfr_set_emin(cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the smallest exponent allowed for a floating-point variable. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_357mpfr_set_emin(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_356mpfr_set_emin, "mpfr_set_emin(mpfr_exp_t exp)\n\n Set the smallest exponent allowed for a floating-point variable.\n\n Raises ValueError when exp is not in the range accepted by the\n implementation (in that case the smallest exponent is not changed).\n\n If the user changes the exponent range, it is her/his responsibility to\n check that all current floating-point variables are in the new allowed\n range (for example using mpfr_check_range), otherwise the subsequent\n behavior will be undefined, in the sense of the ISO C standard.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_357mpfr_set_emin = {"mpfr_set_emin", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_357mpfr_set_emin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_356mpfr_set_emin}; +static PyObject *__pyx_pw_4mpfr_357mpfr_set_emin(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + mpfr_exp_t __pyx_v_exp; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_emin (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exp,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exp)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3102, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_emin") < 0)) __PYX_ERR(1, 3102, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_exp = __Pyx_PyInt_As_mp_exp_t(values[0]); if (unlikely((__pyx_v_exp == ((mpfr_exp_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 3102, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_emin", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3102, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_emin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_356mpfr_set_emin(__pyx_self, __pyx_v_exp); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_356mpfr_set_emin(CYTHON_UNUSED PyObject *__pyx_self, mpfr_exp_t __pyx_v_exp) { + int __pyx_v_error_code; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_emin", 1); + + /* "mpfr.pyx":3115 + * + * """ + * error_code = cmpfr.mpfr_set_emin(exp) # <<<<<<<<<<<<<< + * if error_code: + * raise ValueError("new exponent for emin is outside allowable range") + */ + __pyx_v_error_code = mpfr_set_emin(__pyx_v_exp); + + /* "mpfr.pyx":3116 + * """ + * error_code = cmpfr.mpfr_set_emin(exp) + * if error_code: # <<<<<<<<<<<<<< + * raise ValueError("new exponent for emin is outside allowable range") + * + */ + __pyx_t_1 = (__pyx_v_error_code != 0); + if (unlikely(__pyx_t_1)) { + + /* "mpfr.pyx":3117 + * error_code = cmpfr.mpfr_set_emin(exp) + * if error_code: + * raise ValueError("new exponent for emin is outside allowable range") # <<<<<<<<<<<<<< + * + * def mpfr_set_emax(cmpfr.mpfr_exp_t exp): + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 3117, __pyx_L1_error) + + /* "mpfr.pyx":3116 + * """ + * error_code = cmpfr.mpfr_set_emin(exp) + * if error_code: # <<<<<<<<<<<<<< + * raise ValueError("new exponent for emin is outside allowable range") + * + */ + } + + /* "mpfr.pyx":3102 + * return cmpfr.mpfr_get_emax() + * + * def mpfr_set_emin(cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the smallest exponent allowed for a floating-point variable. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_set_emin", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3119 + * raise ValueError("new exponent for emin is outside allowable range") + * + * def mpfr_set_emax(cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the largest exponent allowed for a floating-point variable. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_359mpfr_set_emax(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_358mpfr_set_emax, "mpfr_set_emax(mpfr_exp_t exp)\n\n Set the largest exponent allowed for a floating-point variable.\n\n Raises ValueError when exp is not in the range accepted by the\n implementation (in that case the largest exponent is not changed).\n\n If the user changes the exponent range, it is her/his responsibility to\n check that all current floating-point variables are in the new allowed\n range (for example using mpfr_check_range), otherwise the subsequent\n behavior will be undefined, in the sense of the ISO C standard.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_359mpfr_set_emax = {"mpfr_set_emax", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_359mpfr_set_emax, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_358mpfr_set_emax}; +static PyObject *__pyx_pw_4mpfr_359mpfr_set_emax(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + mpfr_exp_t __pyx_v_exp; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_emax (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exp,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_exp)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3119, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_set_emax") < 0)) __PYX_ERR(1, 3119, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_exp = __Pyx_PyInt_As_mp_exp_t(values[0]); if (unlikely((__pyx_v_exp == ((mpfr_exp_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 3119, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_set_emax", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3119, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_set_emax", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_358mpfr_set_emax(__pyx_self, __pyx_v_exp); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_358mpfr_set_emax(CYTHON_UNUSED PyObject *__pyx_self, mpfr_exp_t __pyx_v_exp) { + int __pyx_v_error_code; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_set_emax", 1); + + /* "mpfr.pyx":3132 + * + * """ + * error_code = cmpfr.mpfr_set_emax(exp) # <<<<<<<<<<<<<< + * if error_code: + * raise ValueError("new exponent for emin is outside allowable range") + */ + __pyx_v_error_code = mpfr_set_emax(__pyx_v_exp); + + /* "mpfr.pyx":3133 + * """ + * error_code = cmpfr.mpfr_set_emax(exp) + * if error_code: # <<<<<<<<<<<<<< + * raise ValueError("new exponent for emin is outside allowable range") + * + */ + __pyx_t_1 = (__pyx_v_error_code != 0); + if (unlikely(__pyx_t_1)) { + + /* "mpfr.pyx":3134 + * error_code = cmpfr.mpfr_set_emax(exp) + * if error_code: + * raise ValueError("new exponent for emin is outside allowable range") # <<<<<<<<<<<<<< + * + * def mpfr_get_emin_min(): + */ + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __PYX_ERR(1, 3134, __pyx_L1_error) + + /* "mpfr.pyx":3133 + * """ + * error_code = cmpfr.mpfr_set_emax(exp) + * if error_code: # <<<<<<<<<<<<<< + * raise ValueError("new exponent for emin is outside allowable range") + * + */ + } + + /* "mpfr.pyx":3119 + * raise ValueError("new exponent for emin is outside allowable range") + * + * def mpfr_set_emax(cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the largest exponent allowed for a floating-point variable. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_set_emax", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3136 + * raise ValueError("new exponent for emin is outside allowable range") + * + * def mpfr_get_emin_min(): # <<<<<<<<<<<<<< + * """ + * Return the minimum exponent allowed for mpfr_set_emin. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_361mpfr_get_emin_min(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_360mpfr_get_emin_min, "mpfr_get_emin_min()\n\n Return the minimum exponent allowed for mpfr_set_emin.\n\n This value is implementation dependent, thus a program using\n mpfr_set_emin(mpfr_get_emin_min()) may not be portable.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_361mpfr_get_emin_min = {"mpfr_get_emin_min", (PyCFunction)__pyx_pw_4mpfr_361mpfr_get_emin_min, METH_NOARGS, __pyx_doc_4mpfr_360mpfr_get_emin_min}; +static PyObject *__pyx_pw_4mpfr_361mpfr_get_emin_min(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_emin_min (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_360mpfr_get_emin_min(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_360mpfr_get_emin_min(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_emin_min", 1); + + /* "mpfr.pyx":3144 + * + * """ + * return cmpfr.mpfr_get_emin_min() # <<<<<<<<<<<<<< + * + * def mpfr_get_emin_max(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_mp_exp_t(mpfr_get_emin_min()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3136 + * raise ValueError("new exponent for emin is outside allowable range") + * + * def mpfr_get_emin_min(): # <<<<<<<<<<<<<< + * """ + * Return the minimum exponent allowed for mpfr_set_emin. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_get_emin_min", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3146 + * return cmpfr.mpfr_get_emin_min() + * + * def mpfr_get_emin_max(): # <<<<<<<<<<<<<< + * """ + * Return the maximum exponent allowed for mpfr_set_emin. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_363mpfr_get_emin_max(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_362mpfr_get_emin_max, "mpfr_get_emin_max()\n\n Return the maximum exponent allowed for mpfr_set_emin.\n\n This value is implementation dependent, thus a program using\n mpfr_set_emin(mpfr_get_emin_max()) may not be portable.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_363mpfr_get_emin_max = {"mpfr_get_emin_max", (PyCFunction)__pyx_pw_4mpfr_363mpfr_get_emin_max, METH_NOARGS, __pyx_doc_4mpfr_362mpfr_get_emin_max}; +static PyObject *__pyx_pw_4mpfr_363mpfr_get_emin_max(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_emin_max (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_362mpfr_get_emin_max(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_362mpfr_get_emin_max(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_emin_max", 1); + + /* "mpfr.pyx":3154 + * + * """ + * return cmpfr.mpfr_get_emin_max() # <<<<<<<<<<<<<< + * + * def mpfr_get_emax_min(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_mp_exp_t(mpfr_get_emin_max()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3146 + * return cmpfr.mpfr_get_emin_min() + * + * def mpfr_get_emin_max(): # <<<<<<<<<<<<<< + * """ + * Return the maximum exponent allowed for mpfr_set_emin. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_get_emin_max", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3156 + * return cmpfr.mpfr_get_emin_max() + * + * def mpfr_get_emax_min(): # <<<<<<<<<<<<<< + * """ + * Return the minimum exponent allowed for mpfr_set_emax. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_365mpfr_get_emax_min(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_364mpfr_get_emax_min, "mpfr_get_emax_min()\n\n Return the minimum exponent allowed for mpfr_set_emax.\n\n This value is implementation dependent, thus a program using\n mpfr_set_emax(mpfr_get_emax_min()) may not be portable.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_365mpfr_get_emax_min = {"mpfr_get_emax_min", (PyCFunction)__pyx_pw_4mpfr_365mpfr_get_emax_min, METH_NOARGS, __pyx_doc_4mpfr_364mpfr_get_emax_min}; +static PyObject *__pyx_pw_4mpfr_365mpfr_get_emax_min(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_emax_min (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_364mpfr_get_emax_min(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_364mpfr_get_emax_min(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_emax_min", 1); + + /* "mpfr.pyx":3164 + * + * """ + * return cmpfr.mpfr_get_emax_min() # <<<<<<<<<<<<<< + * + * def mpfr_get_emax_max(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_mp_exp_t(mpfr_get_emax_min()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3156 + * return cmpfr.mpfr_get_emin_max() + * + * def mpfr_get_emax_min(): # <<<<<<<<<<<<<< + * """ + * Return the minimum exponent allowed for mpfr_set_emax. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_get_emax_min", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3166 + * return cmpfr.mpfr_get_emax_min() + * + * def mpfr_get_emax_max(): # <<<<<<<<<<<<<< + * """ + * Return the maximum exponent allowed for mpfr_set_emax. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_367mpfr_get_emax_max(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_366mpfr_get_emax_max, "mpfr_get_emax_max()\n\n Return the maximum exponent allowed for mpfr_set_emax.\n\n This value is implementation dependent, thus a program using\n mpfr_set_emax(mpfr_get_emax_max()) may not be portable.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_367mpfr_get_emax_max = {"mpfr_get_emax_max", (PyCFunction)__pyx_pw_4mpfr_367mpfr_get_emax_max, METH_NOARGS, __pyx_doc_4mpfr_366mpfr_get_emax_max}; +static PyObject *__pyx_pw_4mpfr_367mpfr_get_emax_max(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_get_emax_max (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_366mpfr_get_emax_max(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_366mpfr_get_emax_max(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_get_emax_max", 1); + + /* "mpfr.pyx":3174 + * + * """ + * return cmpfr.mpfr_get_emax_max() # <<<<<<<<<<<<<< + * + * def mpfr_check_range(Mpfr_t x not None, int t, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_mp_exp_t(mpfr_get_emax_max()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3166 + * return cmpfr.mpfr_get_emax_min() + * + * def mpfr_get_emax_max(): # <<<<<<<<<<<<<< + * """ + * Return the maximum exponent allowed for mpfr_set_emax. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_get_emax_max", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3176 + * return cmpfr.mpfr_get_emax_max() + * + * def mpfr_check_range(Mpfr_t x not None, int t, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Modify x if necessary to fit into the current exponent range. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_369mpfr_check_range(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_368mpfr_check_range, "mpfr_check_range(Mpfr_t x, int t, mpfr_rnd_t rnd)\n\n Modify x if necessary to fit into the current exponent range.\n\n This function assumes that x is the correctly-rounded value of some real\n value y in the direction rnd and some extended exponent range, and that t\n is the corresponding ternary value. For example, one performed t = mpfr_log\n (x, u, rnd), and y is the exact logarithm of u. Thus t is negative if x is\n smaller than y, positive if x is larger than y, and zero if x equals\n y. This function modifies x if needed to be in the current range of\n acceptable values: It generates an underflow or an overflow if the exponent\n of x is outside the current allowed range; the value of t may be used to\n avoid a double rounding. This function returns zero if the new value of x\n equals the exact one y, a positive value if that new value is larger than\n y, and a negative value if it is smaller than y. Note that unlike most\n functions, the new result x is compared to the (unknown) exact one y, not\n the input value x, i.e., the ternary value is propagated.\n\n Note: If x is an infinity and t is different from zero (i.e., if the\n rounded result is an inexact infinity), then the overflow flag is set. This\n is useful because mpfr_check_range is typically called (at least in MPFR\n functions) after restoring the flags that could have been set due to\n internal computations.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_369mpfr_check_range = {"mpfr_check_range", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_369mpfr_check_range, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_368mpfr_check_range}; +static PyObject *__pyx_pw_4mpfr_369mpfr_check_range(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + int __pyx_v_t; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_check_range (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3176, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3176, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_check_range", 1, 3, 3, 1); __PYX_ERR(1, 3176, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3176, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_check_range", 1, 3, 3, 2); __PYX_ERR(1, 3176, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_check_range") < 0)) __PYX_ERR(1, 3176, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_t = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_t == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 3176, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3176, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_check_range", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 3176, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_check_range", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 3176, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_368mpfr_check_range(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_368mpfr_check_range(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, int __pyx_v_t, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_check_range", 1); + + /* "mpfr.pyx":3201 + * + * """ + * check_initialized(x) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_check_range(&x._value, t, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 3201, __pyx_L1_error) + + /* "mpfr.pyx":3202 + * """ + * check_initialized(x) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_check_range(&x._value, t, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 3202, __pyx_L1_error) + + /* "mpfr.pyx":3203 + * check_initialized(x) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_check_range(&x._value, t, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_subnormalize(Mpfr_t x not None, int t, cmpfr.mpfr_rnd_t rnd): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_check_range((&__pyx_v_x->_value), __pyx_v_t, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3176 + * return cmpfr.mpfr_get_emax_max() + * + * def mpfr_check_range(Mpfr_t x not None, int t, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Modify x if necessary to fit into the current exponent range. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_check_range", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3205 + * return cmpfr.mpfr_check_range(&x._value, t, rnd) + * + * def mpfr_subnormalize(Mpfr_t x not None, int t, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Modify x if necessary to account for subnormalization. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_371mpfr_subnormalize(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_370mpfr_subnormalize, "mpfr_subnormalize(Mpfr_t x, int t, mpfr_rnd_t rnd)\n\n Modify x if necessary to account for subnormalization.\n\n This function rounds x emulating subnormal number arithmetic: if x is\n outside the subnormal exponent range, it just propagates the ternary value\n t; otherwise, it rounds x to precision EXP(x)-emin+1 according to rounding\n mode rnd and previous ternary value t, avoiding double rounding\n problems. More precisely in the subnormal domain, denoting by e the value\n of emin, x is rounded in fixed-point arithmetic to an integer multiple of\n two to the power e\342\210\2221; as a consequence, 1.5 multiplied by two to the power\n e\342\210\2221 when t is zero is rounded to two to the power e with rounding to\n nearest.\n\n PREC(x) is not modified by this function. rnd and t must be the rounding\n mode and the returned ternary value used when computing x (as in\n mpfr_check_range). The subnormal exponent range is from emin to\n emin+PREC(x)-1. If the result cannot be represented in the current exponent\n range (due to a too small emax), the behavior is undefined. Note that\n unlike most functions, the result is compared to the exact one, not the\n input value x, i.e., the ternary value is propagated.\n\n As usual, if the returned ternary value is non zero, the inexact flag is\n set. Moreover, if a second rounding occurred (because the input x was in\n the subnormal range), the underflow flag is set.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_371mpfr_subnormalize = {"mpfr_subnormalize", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_371mpfr_subnormalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_370mpfr_subnormalize}; +static PyObject *__pyx_pw_4mpfr_371mpfr_subnormalize(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x = 0; + int __pyx_v_t; + mpfr_rnd_t __pyx_v_rnd; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_subnormalize (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_rnd,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3205, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3205, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_subnormalize", 1, 3, 3, 1); __PYX_ERR(1, 3205, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rnd)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3205, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_subnormalize", 1, 3, 3, 2); __PYX_ERR(1, 3205, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_subnormalize") < 0)) __PYX_ERR(1, 3205, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_x = ((struct __pyx_obj_4mpfr_Mpfr_t *)values[0]); + __pyx_v_t = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_t == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 3205, __pyx_L3_error) + __pyx_v_rnd = ((mpfr_rnd_t)__Pyx_PyInt_As_mpfr_rnd_t(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3205, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_subnormalize", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 3205, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_subnormalize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4mpfr_Mpfr_t, 0, "x", 0))) __PYX_ERR(1, 3205, __pyx_L1_error) + __pyx_r = __pyx_pf_4mpfr_370mpfr_subnormalize(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_rnd); + + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_370mpfr_subnormalize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_4mpfr_Mpfr_t *__pyx_v_x, int __pyx_v_t, mpfr_rnd_t __pyx_v_rnd) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_subnormalize", 1); + + /* "mpfr.pyx":3232 + * + * """ + * check_initialized(x) # <<<<<<<<<<<<<< + * check_rounding_mode(rnd) + * return cmpfr.mpfr_subnormalize(&x._value, t, rnd) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_initialized(__pyx_v_x); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 3232, __pyx_L1_error) + + /* "mpfr.pyx":3233 + * """ + * check_initialized(x) + * check_rounding_mode(rnd) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_subnormalize(&x._value, t, rnd) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_rounding_mode(__pyx_v_rnd); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 3233, __pyx_L1_error) + + /* "mpfr.pyx":3234 + * check_initialized(x) + * check_rounding_mode(rnd) + * return cmpfr.mpfr_subnormalize(&x._value, t, rnd) # <<<<<<<<<<<<<< + * + * def mpfr_clear_underflow(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_int(mpfr_subnormalize((&__pyx_v_x->_value), __pyx_v_t, __pyx_v_rnd)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3205 + * return cmpfr.mpfr_check_range(&x._value, t, rnd) + * + * def mpfr_subnormalize(Mpfr_t x not None, int t, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Modify x if necessary to account for subnormalization. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_subnormalize", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3236 + * return cmpfr.mpfr_subnormalize(&x._value, t, rnd) + * + * def mpfr_clear_underflow(): # <<<<<<<<<<<<<< + * """ + * Clear the underflow flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_373mpfr_clear_underflow(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_372mpfr_clear_underflow, "mpfr_clear_underflow()\n\n Clear the underflow flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_373mpfr_clear_underflow = {"mpfr_clear_underflow", (PyCFunction)__pyx_pw_4mpfr_373mpfr_clear_underflow, METH_NOARGS, __pyx_doc_4mpfr_372mpfr_clear_underflow}; +static PyObject *__pyx_pw_4mpfr_373mpfr_clear_underflow(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_underflow (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_372mpfr_clear_underflow(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_372mpfr_clear_underflow(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_underflow", 1); + + /* "mpfr.pyx":3241 + * + * """ + * cmpfr.mpfr_clear_underflow() # <<<<<<<<<<<<<< + * + * def mpfr_clear_overflow(): + */ + mpfr_clear_underflow(); + + /* "mpfr.pyx":3236 + * return cmpfr.mpfr_subnormalize(&x._value, t, rnd) + * + * def mpfr_clear_underflow(): # <<<<<<<<<<<<<< + * """ + * Clear the underflow flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3243 + * cmpfr.mpfr_clear_underflow() + * + * def mpfr_clear_overflow(): # <<<<<<<<<<<<<< + * """ + * Clear the overflow flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_375mpfr_clear_overflow(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_374mpfr_clear_overflow, "mpfr_clear_overflow()\n\n Clear the overflow flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_375mpfr_clear_overflow = {"mpfr_clear_overflow", (PyCFunction)__pyx_pw_4mpfr_375mpfr_clear_overflow, METH_NOARGS, __pyx_doc_4mpfr_374mpfr_clear_overflow}; +static PyObject *__pyx_pw_4mpfr_375mpfr_clear_overflow(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_overflow (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_374mpfr_clear_overflow(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_374mpfr_clear_overflow(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_overflow", 1); + + /* "mpfr.pyx":3248 + * + * """ + * cmpfr.mpfr_clear_overflow() # <<<<<<<<<<<<<< + * + * def mpfr_clear_divby0(): + */ + mpfr_clear_overflow(); + + /* "mpfr.pyx":3243 + * cmpfr.mpfr_clear_underflow() + * + * def mpfr_clear_overflow(): # <<<<<<<<<<<<<< + * """ + * Clear the overflow flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3250 + * cmpfr.mpfr_clear_overflow() + * + * def mpfr_clear_divby0(): # <<<<<<<<<<<<<< + * """ + * Clear the divide-by-zero flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_377mpfr_clear_divby0(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_376mpfr_clear_divby0, "mpfr_clear_divby0()\n\n Clear the divide-by-zero flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_377mpfr_clear_divby0 = {"mpfr_clear_divby0", (PyCFunction)__pyx_pw_4mpfr_377mpfr_clear_divby0, METH_NOARGS, __pyx_doc_4mpfr_376mpfr_clear_divby0}; +static PyObject *__pyx_pw_4mpfr_377mpfr_clear_divby0(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_divby0 (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_376mpfr_clear_divby0(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_376mpfr_clear_divby0(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_divby0", 1); + + /* "mpfr.pyx":3255 + * + * """ + * cmpfr.mpfr_clear_divby0() # <<<<<<<<<<<<<< + * + * def mpfr_clear_nanflag(): + */ + mpfr_clear_divby0(); + + /* "mpfr.pyx":3250 + * cmpfr.mpfr_clear_overflow() + * + * def mpfr_clear_divby0(): # <<<<<<<<<<<<<< + * """ + * Clear the divide-by-zero flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3257 + * cmpfr.mpfr_clear_divby0() + * + * def mpfr_clear_nanflag(): # <<<<<<<<<<<<<< + * """ + * Clear the invalid flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_379mpfr_clear_nanflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_378mpfr_clear_nanflag, "mpfr_clear_nanflag()\n\n Clear the invalid flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_379mpfr_clear_nanflag = {"mpfr_clear_nanflag", (PyCFunction)__pyx_pw_4mpfr_379mpfr_clear_nanflag, METH_NOARGS, __pyx_doc_4mpfr_378mpfr_clear_nanflag}; +static PyObject *__pyx_pw_4mpfr_379mpfr_clear_nanflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_nanflag (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_378mpfr_clear_nanflag(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_378mpfr_clear_nanflag(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_nanflag", 1); + + /* "mpfr.pyx":3262 + * + * """ + * cmpfr.mpfr_clear_nanflag() # <<<<<<<<<<<<<< + * + * def mpfr_clear_inexflag(): + */ + mpfr_clear_nanflag(); + + /* "mpfr.pyx":3257 + * cmpfr.mpfr_clear_divby0() + * + * def mpfr_clear_nanflag(): # <<<<<<<<<<<<<< + * """ + * Clear the invalid flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3264 + * cmpfr.mpfr_clear_nanflag() + * + * def mpfr_clear_inexflag(): # <<<<<<<<<<<<<< + * """ + * Clear the inexact flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_381mpfr_clear_inexflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_380mpfr_clear_inexflag, "mpfr_clear_inexflag()\n\n Clear the inexact flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_381mpfr_clear_inexflag = {"mpfr_clear_inexflag", (PyCFunction)__pyx_pw_4mpfr_381mpfr_clear_inexflag, METH_NOARGS, __pyx_doc_4mpfr_380mpfr_clear_inexflag}; +static PyObject *__pyx_pw_4mpfr_381mpfr_clear_inexflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_inexflag (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_380mpfr_clear_inexflag(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_380mpfr_clear_inexflag(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_inexflag", 1); + + /* "mpfr.pyx":3269 + * + * """ + * cmpfr.mpfr_clear_inexflag() # <<<<<<<<<<<<<< + * + * def mpfr_clear_erangeflag(): + */ + mpfr_clear_inexflag(); + + /* "mpfr.pyx":3264 + * cmpfr.mpfr_clear_nanflag() + * + * def mpfr_clear_inexflag(): # <<<<<<<<<<<<<< + * """ + * Clear the inexact flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3271 + * cmpfr.mpfr_clear_inexflag() + * + * def mpfr_clear_erangeflag(): # <<<<<<<<<<<<<< + * """ + * Clear the erange flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_383mpfr_clear_erangeflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_382mpfr_clear_erangeflag, "mpfr_clear_erangeflag()\n\n Clear the erange flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_383mpfr_clear_erangeflag = {"mpfr_clear_erangeflag", (PyCFunction)__pyx_pw_4mpfr_383mpfr_clear_erangeflag, METH_NOARGS, __pyx_doc_4mpfr_382mpfr_clear_erangeflag}; +static PyObject *__pyx_pw_4mpfr_383mpfr_clear_erangeflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_erangeflag (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_382mpfr_clear_erangeflag(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_382mpfr_clear_erangeflag(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_erangeflag", 1); + + /* "mpfr.pyx":3276 + * + * """ + * cmpfr.mpfr_clear_erangeflag() # <<<<<<<<<<<<<< + * + * def mpfr_set_underflow(): + */ + mpfr_clear_erangeflag(); + + /* "mpfr.pyx":3271 + * cmpfr.mpfr_clear_inexflag() + * + * def mpfr_clear_erangeflag(): # <<<<<<<<<<<<<< + * """ + * Clear the erange flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3278 + * cmpfr.mpfr_clear_erangeflag() + * + * def mpfr_set_underflow(): # <<<<<<<<<<<<<< + * """ + * Set the underflow flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_385mpfr_set_underflow(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_384mpfr_set_underflow, "mpfr_set_underflow()\n\n Set the underflow flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_385mpfr_set_underflow = {"mpfr_set_underflow", (PyCFunction)__pyx_pw_4mpfr_385mpfr_set_underflow, METH_NOARGS, __pyx_doc_4mpfr_384mpfr_set_underflow}; +static PyObject *__pyx_pw_4mpfr_385mpfr_set_underflow(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_underflow (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_384mpfr_set_underflow(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_384mpfr_set_underflow(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_underflow", 1); + + /* "mpfr.pyx":3283 + * + * """ + * cmpfr.mpfr_set_underflow() # <<<<<<<<<<<<<< + * + * def mpfr_set_overflow(): + */ + mpfr_set_underflow(); + + /* "mpfr.pyx":3278 + * cmpfr.mpfr_clear_erangeflag() + * + * def mpfr_set_underflow(): # <<<<<<<<<<<<<< + * """ + * Set the underflow flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3285 + * cmpfr.mpfr_set_underflow() + * + * def mpfr_set_overflow(): # <<<<<<<<<<<<<< + * """ + * Set the overflow flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_387mpfr_set_overflow(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_386mpfr_set_overflow, "mpfr_set_overflow()\n\n Set the overflow flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_387mpfr_set_overflow = {"mpfr_set_overflow", (PyCFunction)__pyx_pw_4mpfr_387mpfr_set_overflow, METH_NOARGS, __pyx_doc_4mpfr_386mpfr_set_overflow}; +static PyObject *__pyx_pw_4mpfr_387mpfr_set_overflow(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_overflow (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_386mpfr_set_overflow(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_386mpfr_set_overflow(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_overflow", 1); + + /* "mpfr.pyx":3290 + * + * """ + * cmpfr.mpfr_set_overflow() # <<<<<<<<<<<<<< + * + * def mpfr_set_divby0(): + */ + mpfr_set_overflow(); + + /* "mpfr.pyx":3285 + * cmpfr.mpfr_set_underflow() + * + * def mpfr_set_overflow(): # <<<<<<<<<<<<<< + * """ + * Set the overflow flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3292 + * cmpfr.mpfr_set_overflow() + * + * def mpfr_set_divby0(): # <<<<<<<<<<<<<< + * """ + * Set the divide-by-zero flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_389mpfr_set_divby0(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_388mpfr_set_divby0, "mpfr_set_divby0()\n\n Set the divide-by-zero flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_389mpfr_set_divby0 = {"mpfr_set_divby0", (PyCFunction)__pyx_pw_4mpfr_389mpfr_set_divby0, METH_NOARGS, __pyx_doc_4mpfr_388mpfr_set_divby0}; +static PyObject *__pyx_pw_4mpfr_389mpfr_set_divby0(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_divby0 (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_388mpfr_set_divby0(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_388mpfr_set_divby0(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_divby0", 1); + + /* "mpfr.pyx":3297 + * + * """ + * cmpfr.mpfr_set_divby0() # <<<<<<<<<<<<<< + * + * def mpfr_set_nanflag(): + */ + mpfr_set_divby0(); + + /* "mpfr.pyx":3292 + * cmpfr.mpfr_set_overflow() + * + * def mpfr_set_divby0(): # <<<<<<<<<<<<<< + * """ + * Set the divide-by-zero flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3299 + * cmpfr.mpfr_set_divby0() + * + * def mpfr_set_nanflag(): # <<<<<<<<<<<<<< + * """ + * Set the invalid flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_391mpfr_set_nanflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_390mpfr_set_nanflag, "mpfr_set_nanflag()\n\n Set the invalid flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_391mpfr_set_nanflag = {"mpfr_set_nanflag", (PyCFunction)__pyx_pw_4mpfr_391mpfr_set_nanflag, METH_NOARGS, __pyx_doc_4mpfr_390mpfr_set_nanflag}; +static PyObject *__pyx_pw_4mpfr_391mpfr_set_nanflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_nanflag (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_390mpfr_set_nanflag(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_390mpfr_set_nanflag(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_nanflag", 1); + + /* "mpfr.pyx":3304 + * + * """ + * cmpfr.mpfr_set_nanflag() # <<<<<<<<<<<<<< + * + * def mpfr_set_inexflag(): + */ + mpfr_set_nanflag(); + + /* "mpfr.pyx":3299 + * cmpfr.mpfr_set_divby0() + * + * def mpfr_set_nanflag(): # <<<<<<<<<<<<<< + * """ + * Set the invalid flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3306 + * cmpfr.mpfr_set_nanflag() + * + * def mpfr_set_inexflag(): # <<<<<<<<<<<<<< + * """ + * Set the inexact flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_393mpfr_set_inexflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_392mpfr_set_inexflag, "mpfr_set_inexflag()\n\n Set the inexact flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_393mpfr_set_inexflag = {"mpfr_set_inexflag", (PyCFunction)__pyx_pw_4mpfr_393mpfr_set_inexflag, METH_NOARGS, __pyx_doc_4mpfr_392mpfr_set_inexflag}; +static PyObject *__pyx_pw_4mpfr_393mpfr_set_inexflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_inexflag (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_392mpfr_set_inexflag(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_392mpfr_set_inexflag(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_inexflag", 1); + + /* "mpfr.pyx":3311 + * + * """ + * cmpfr.mpfr_set_inexflag() # <<<<<<<<<<<<<< + * + * def mpfr_set_erangeflag(): + */ + mpfr_set_inexflag(); + + /* "mpfr.pyx":3306 + * cmpfr.mpfr_set_nanflag() + * + * def mpfr_set_inexflag(): # <<<<<<<<<<<<<< + * """ + * Set the inexact flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3313 + * cmpfr.mpfr_set_inexflag() + * + * def mpfr_set_erangeflag(): # <<<<<<<<<<<<<< + * """ + * Set the erange flag. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_395mpfr_set_erangeflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_394mpfr_set_erangeflag, "mpfr_set_erangeflag()\n\n Set the erange flag.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_395mpfr_set_erangeflag = {"mpfr_set_erangeflag", (PyCFunction)__pyx_pw_4mpfr_395mpfr_set_erangeflag, METH_NOARGS, __pyx_doc_4mpfr_394mpfr_set_erangeflag}; +static PyObject *__pyx_pw_4mpfr_395mpfr_set_erangeflag(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_erangeflag (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_394mpfr_set_erangeflag(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_394mpfr_set_erangeflag(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_set_erangeflag", 1); + + /* "mpfr.pyx":3318 + * + * """ + * cmpfr.mpfr_set_erangeflag() # <<<<<<<<<<<<<< + * + * def mpfr_clear_flags(): + */ + mpfr_set_erangeflag(); + + /* "mpfr.pyx":3313 + * cmpfr.mpfr_set_inexflag() + * + * def mpfr_set_erangeflag(): # <<<<<<<<<<<<<< + * """ + * Set the erange flag. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3320 + * cmpfr.mpfr_set_erangeflag() + * + * def mpfr_clear_flags(): # <<<<<<<<<<<<<< + * """ + * Clear all global flags. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_397mpfr_clear_flags(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_396mpfr_clear_flags, "mpfr_clear_flags()\n\n Clear all global flags.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_397mpfr_clear_flags = {"mpfr_clear_flags", (PyCFunction)__pyx_pw_4mpfr_397mpfr_clear_flags, METH_NOARGS, __pyx_doc_4mpfr_396mpfr_clear_flags}; +static PyObject *__pyx_pw_4mpfr_397mpfr_clear_flags(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_flags (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_396mpfr_clear_flags(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_396mpfr_clear_flags(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_clear_flags", 1); + + /* "mpfr.pyx":3325 + * + * """ + * cmpfr.mpfr_clear_flags() # <<<<<<<<<<<<<< + * + * def mpfr_underflow_p(): + */ + mpfr_clear_flags(); + + /* "mpfr.pyx":3320 + * cmpfr.mpfr_set_erangeflag() + * + * def mpfr_clear_flags(): # <<<<<<<<<<<<<< + * """ + * Clear all global flags. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3327 + * cmpfr.mpfr_clear_flags() + * + * def mpfr_underflow_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the underflow flag is set, else False. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_399mpfr_underflow_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_398mpfr_underflow_p, "mpfr_underflow_p()\n\n Return True if the underflow flag is set, else False.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_399mpfr_underflow_p = {"mpfr_underflow_p", (PyCFunction)__pyx_pw_4mpfr_399mpfr_underflow_p, METH_NOARGS, __pyx_doc_4mpfr_398mpfr_underflow_p}; +static PyObject *__pyx_pw_4mpfr_399mpfr_underflow_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_underflow_p (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_398mpfr_underflow_p(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_398mpfr_underflow_p(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_underflow_p", 1); + + /* "mpfr.pyx":3332 + * + * """ + * return bool(cmpfr.mpfr_underflow_p()) # <<<<<<<<<<<<<< + * + * def mpfr_overflow_p(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_underflow_p()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 3332, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3332, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3327 + * cmpfr.mpfr_clear_flags() + * + * def mpfr_underflow_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the underflow flag is set, else False. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_underflow_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3334 + * return bool(cmpfr.mpfr_underflow_p()) + * + * def mpfr_overflow_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the overflow flag is set, else False. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_401mpfr_overflow_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_400mpfr_overflow_p, "mpfr_overflow_p()\n\n Return True if the overflow flag is set, else False.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_401mpfr_overflow_p = {"mpfr_overflow_p", (PyCFunction)__pyx_pw_4mpfr_401mpfr_overflow_p, METH_NOARGS, __pyx_doc_4mpfr_400mpfr_overflow_p}; +static PyObject *__pyx_pw_4mpfr_401mpfr_overflow_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_overflow_p (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_400mpfr_overflow_p(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_400mpfr_overflow_p(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_overflow_p", 1); + + /* "mpfr.pyx":3339 + * + * """ + * return bool(cmpfr.mpfr_overflow_p()) # <<<<<<<<<<<<<< + * + * def mpfr_divby0_p(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_overflow_p()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 3339, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3334 + * return bool(cmpfr.mpfr_underflow_p()) + * + * def mpfr_overflow_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the overflow flag is set, else False. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_overflow_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3341 + * return bool(cmpfr.mpfr_overflow_p()) + * + * def mpfr_divby0_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the divide-by-zero flag is set, else False. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_403mpfr_divby0_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_402mpfr_divby0_p, "mpfr_divby0_p()\n\n Return True if the divide-by-zero flag is set, else False.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_403mpfr_divby0_p = {"mpfr_divby0_p", (PyCFunction)__pyx_pw_4mpfr_403mpfr_divby0_p, METH_NOARGS, __pyx_doc_4mpfr_402mpfr_divby0_p}; +static PyObject *__pyx_pw_4mpfr_403mpfr_divby0_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_divby0_p (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_402mpfr_divby0_p(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_402mpfr_divby0_p(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_divby0_p", 1); + + /* "mpfr.pyx":3346 + * + * """ + * return bool(cmpfr.mpfr_divby0_p()) # <<<<<<<<<<<<<< + * + * def mpfr_nanflag_p(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_divby0_p()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 3346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3341 + * return bool(cmpfr.mpfr_overflow_p()) + * + * def mpfr_divby0_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the divide-by-zero flag is set, else False. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_divby0_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3348 + * return bool(cmpfr.mpfr_divby0_p()) + * + * def mpfr_nanflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the invalid flag is set, else False. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_405mpfr_nanflag_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_404mpfr_nanflag_p, "mpfr_nanflag_p()\n\n Return True if the invalid flag is set, else False.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_405mpfr_nanflag_p = {"mpfr_nanflag_p", (PyCFunction)__pyx_pw_4mpfr_405mpfr_nanflag_p, METH_NOARGS, __pyx_doc_4mpfr_404mpfr_nanflag_p}; +static PyObject *__pyx_pw_4mpfr_405mpfr_nanflag_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_nanflag_p (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_404mpfr_nanflag_p(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_404mpfr_nanflag_p(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_nanflag_p", 1); + + /* "mpfr.pyx":3353 + * + * """ + * return bool(cmpfr.mpfr_nanflag_p()) # <<<<<<<<<<<<<< + * + * def mpfr_inexflag_p(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_nanflag_p()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 3353, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3353, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3348 + * return bool(cmpfr.mpfr_divby0_p()) + * + * def mpfr_nanflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the invalid flag is set, else False. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_nanflag_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3355 + * return bool(cmpfr.mpfr_nanflag_p()) + * + * def mpfr_inexflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the inexact flag is set, else False. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_407mpfr_inexflag_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_406mpfr_inexflag_p, "mpfr_inexflag_p()\n\n Return True if the inexact flag is set, else False.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_407mpfr_inexflag_p = {"mpfr_inexflag_p", (PyCFunction)__pyx_pw_4mpfr_407mpfr_inexflag_p, METH_NOARGS, __pyx_doc_4mpfr_406mpfr_inexflag_p}; +static PyObject *__pyx_pw_4mpfr_407mpfr_inexflag_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_inexflag_p (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_406mpfr_inexflag_p(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_406mpfr_inexflag_p(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_inexflag_p", 1); + + /* "mpfr.pyx":3360 + * + * """ + * return bool(cmpfr.mpfr_inexflag_p()) # <<<<<<<<<<<<<< + * + * def mpfr_erangeflag_p(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_inexflag_p()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 3360, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3355 + * return bool(cmpfr.mpfr_nanflag_p()) + * + * def mpfr_inexflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the inexact flag is set, else False. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_inexflag_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3362 + * return bool(cmpfr.mpfr_inexflag_p()) + * + * def mpfr_erangeflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the erange flag is set, else False. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_409mpfr_erangeflag_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_408mpfr_erangeflag_p, "mpfr_erangeflag_p()\n\n Return True if the erange flag is set, else False.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_409mpfr_erangeflag_p = {"mpfr_erangeflag_p", (PyCFunction)__pyx_pw_4mpfr_409mpfr_erangeflag_p, METH_NOARGS, __pyx_doc_4mpfr_408mpfr_erangeflag_p}; +static PyObject *__pyx_pw_4mpfr_409mpfr_erangeflag_p(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_erangeflag_p (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_408mpfr_erangeflag_p(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_408mpfr_erangeflag_p(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_erangeflag_p", 1); + + /* "mpfr.pyx":3367 + * + * """ + * return bool(cmpfr.mpfr_erangeflag_p()) # <<<<<<<<<<<<<< + * + * def mpfr_flags_clear(cmpfr.mpfr_flags_t mask): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_int(mpfr_erangeflag_p()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 3367, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3367, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3362 + * return bool(cmpfr.mpfr_inexflag_p()) + * + * def mpfr_erangeflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the erange flag is set, else False. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_erangeflag_p", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3369 + * return bool(cmpfr.mpfr_erangeflag_p()) + * + * def mpfr_flags_clear(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Clear (lower) the group of flags specified by mask. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_411mpfr_flags_clear(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_410mpfr_flags_clear, "mpfr_flags_clear(mpfr_flags_t mask)\n\n Clear (lower) the group of flags specified by mask.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_411mpfr_flags_clear = {"mpfr_flags_clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_411mpfr_flags_clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_410mpfr_flags_clear}; +static PyObject *__pyx_pw_4mpfr_411mpfr_flags_clear(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + mpfr_flags_t __pyx_v_mask; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_flags_clear (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mask,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mask)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3369, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_flags_clear") < 0)) __PYX_ERR(1, 3369, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_mask = __Pyx_PyInt_As_mpfr_flags_t(values[0]); if (unlikely((__pyx_v_mask == ((mpfr_flags_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 3369, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_flags_clear", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3369, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_flags_clear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_410mpfr_flags_clear(__pyx_self, __pyx_v_mask); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_410mpfr_flags_clear(CYTHON_UNUSED PyObject *__pyx_self, mpfr_flags_t __pyx_v_mask) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_flags_clear", 1); + + /* "mpfr.pyx":3374 + * + * """ + * check_flag_mask(mask) # <<<<<<<<<<<<<< + * cmpfr.mpfr_flags_clear(mask) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_flag_mask(__pyx_v_mask); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 3374, __pyx_L1_error) + + /* "mpfr.pyx":3375 + * """ + * check_flag_mask(mask) + * cmpfr.mpfr_flags_clear(mask) # <<<<<<<<<<<<<< + * + * def mpfr_flags_set(cmpfr.mpfr_flags_t mask): + */ + mpfr_flags_clear(__pyx_v_mask); + + /* "mpfr.pyx":3369 + * return bool(cmpfr.mpfr_erangeflag_p()) + * + * def mpfr_flags_clear(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Clear (lower) the group of flags specified by mask. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_flags_clear", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3377 + * cmpfr.mpfr_flags_clear(mask) + * + * def mpfr_flags_set(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Set (raise) the group of flags specified by mask. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_413mpfr_flags_set(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_412mpfr_flags_set, "mpfr_flags_set(mpfr_flags_t mask)\n\n Set (raise) the group of flags specified by mask.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_413mpfr_flags_set = {"mpfr_flags_set", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_413mpfr_flags_set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_412mpfr_flags_set}; +static PyObject *__pyx_pw_4mpfr_413mpfr_flags_set(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + mpfr_flags_t __pyx_v_mask; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_flags_set (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mask,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mask)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3377, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_flags_set") < 0)) __PYX_ERR(1, 3377, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_mask = __Pyx_PyInt_As_mpfr_flags_t(values[0]); if (unlikely((__pyx_v_mask == ((mpfr_flags_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 3377, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_flags_set", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3377, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_flags_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_412mpfr_flags_set(__pyx_self, __pyx_v_mask); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_412mpfr_flags_set(CYTHON_UNUSED PyObject *__pyx_self, mpfr_flags_t __pyx_v_mask) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_flags_set", 1); + + /* "mpfr.pyx":3382 + * + * """ + * check_flag_mask(mask) # <<<<<<<<<<<<<< + * cmpfr.mpfr_flags_set(mask) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_flag_mask(__pyx_v_mask); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 3382, __pyx_L1_error) + + /* "mpfr.pyx":3383 + * """ + * check_flag_mask(mask) + * cmpfr.mpfr_flags_set(mask) # <<<<<<<<<<<<<< + * + * def mpfr_flags_test(cmpfr.mpfr_flags_t mask): + */ + mpfr_flags_set(__pyx_v_mask); + + /* "mpfr.pyx":3377 + * cmpfr.mpfr_flags_clear(mask) + * + * def mpfr_flags_set(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Set (raise) the group of flags specified by mask. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_flags_set", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3385 + * cmpfr.mpfr_flags_set(mask) + * + * def mpfr_flags_test(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Return the flags specified by mask. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_415mpfr_flags_test(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_414mpfr_flags_test, "mpfr_flags_test(mpfr_flags_t mask)\n\n Return the flags specified by mask.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_415mpfr_flags_test = {"mpfr_flags_test", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_415mpfr_flags_test, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_414mpfr_flags_test}; +static PyObject *__pyx_pw_4mpfr_415mpfr_flags_test(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + mpfr_flags_t __pyx_v_mask; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_flags_test (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mask,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mask)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3385, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_flags_test") < 0)) __PYX_ERR(1, 3385, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_mask = __Pyx_PyInt_As_mpfr_flags_t(values[0]); if (unlikely((__pyx_v_mask == ((mpfr_flags_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 3385, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_flags_test", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3385, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_flags_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_414mpfr_flags_test(__pyx_self, __pyx_v_mask); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_414mpfr_flags_test(CYTHON_UNUSED PyObject *__pyx_self, mpfr_flags_t __pyx_v_mask) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_flags_test", 1); + + /* "mpfr.pyx":3390 + * + * """ + * check_flag_mask(mask) # <<<<<<<<<<<<<< + * return cmpfr.mpfr_flags_test(mask) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_flag_mask(__pyx_v_mask); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 3390, __pyx_L1_error) + + /* "mpfr.pyx":3391 + * """ + * check_flag_mask(mask) + * return cmpfr.mpfr_flags_test(mask) # <<<<<<<<<<<<<< + * + * def mpfr_flags_save(): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_From_mpfr_flags_t(mpfr_flags_test(__pyx_v_mask)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3391, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3385 + * cmpfr.mpfr_flags_set(mask) + * + * def mpfr_flags_test(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Return the flags specified by mask. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("mpfr.mpfr_flags_test", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3393 + * return cmpfr.mpfr_flags_test(mask) + * + * def mpfr_flags_save(): # <<<<<<<<<<<<<< + * """ + * Return all the flags. This is equivalent to mpfr_flags_test(MPFR_FLAGS_ALL) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_417mpfr_flags_save(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_416mpfr_flags_save, "mpfr_flags_save()\n\n Return all the flags. This is equivalent to mpfr_flags_test(MPFR_FLAGS_ALL)\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_417mpfr_flags_save = {"mpfr_flags_save", (PyCFunction)__pyx_pw_4mpfr_417mpfr_flags_save, METH_NOARGS, __pyx_doc_4mpfr_416mpfr_flags_save}; +static PyObject *__pyx_pw_4mpfr_417mpfr_flags_save(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_flags_save (wrapper)", 0); + __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); + __pyx_r = __pyx_pf_4mpfr_416mpfr_flags_save(__pyx_self); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_416mpfr_flags_save(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_flags_save", 1); + + /* "mpfr.pyx":3398 + * + * """ + * return cmpfr.mpfr_flags_save() # <<<<<<<<<<<<<< + * + * def mpfr_flags_restore(cmpfr.mpfr_flags_t flags, cmpfr.mpfr_flags_t mask): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyInt_From_mpfr_flags_t(mpfr_flags_save()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3398, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "mpfr.pyx":3393 + * return cmpfr.mpfr_flags_test(mask) + * + * def mpfr_flags_save(): # <<<<<<<<<<<<<< + * """ + * Return all the flags. This is equivalent to mpfr_flags_test(MPFR_FLAGS_ALL) + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("mpfr.mpfr_flags_save", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "mpfr.pyx":3400 + * return cmpfr.mpfr_flags_save() + * + * def mpfr_flags_restore(cmpfr.mpfr_flags_t flags, cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Set the current flag state from an integer. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_4mpfr_419mpfr_flags_restore(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_4mpfr_418mpfr_flags_restore, "mpfr_flags_restore(mpfr_flags_t flags, mpfr_flags_t mask)\n\n Set the current flag state from an integer.\n\n Restore the flags specified by mask to their state represented in flags.\n\n "); +static PyMethodDef __pyx_mdef_4mpfr_419mpfr_flags_restore = {"mpfr_flags_restore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_419mpfr_flags_restore, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_418mpfr_flags_restore}; +static PyObject *__pyx_pw_4mpfr_419mpfr_flags_restore(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + mpfr_flags_t __pyx_v_flags; + mpfr_flags_t __pyx_v_mask; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("mpfr_flags_restore (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags,&__pyx_n_s_mask,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3400, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mask)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3400, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("mpfr_flags_restore", 1, 2, 2, 1); __PYX_ERR(1, 3400, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "mpfr_flags_restore") < 0)) __PYX_ERR(1, 3400, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_flags = __Pyx_PyInt_As_mpfr_flags_t(values[0]); if (unlikely((__pyx_v_flags == ((mpfr_flags_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 3400, __pyx_L3_error) + __pyx_v_mask = __Pyx_PyInt_As_mpfr_flags_t(values[1]); if (unlikely((__pyx_v_mask == ((mpfr_flags_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 3400, __pyx_L3_error) + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("mpfr_flags_restore", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 3400, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("mpfr.mpfr_flags_restore", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_4mpfr_418mpfr_flags_restore(__pyx_self, __pyx_v_flags, __pyx_v_mask); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_4mpfr_418mpfr_flags_restore(CYTHON_UNUSED PyObject *__pyx_self, mpfr_flags_t __pyx_v_flags, mpfr_flags_t __pyx_v_mask) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("mpfr_flags_restore", 1); + + /* "mpfr.pyx":3407 + * + * """ + * check_flag_mask(flags) # <<<<<<<<<<<<<< + * check_flag_mask(mask) + * cmpfr.mpfr_flags_restore(flags, mask) + */ + __pyx_t_1 = __pyx_f_4mpfr_check_flag_mask(__pyx_v_flags); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 3407, __pyx_L1_error) + + /* "mpfr.pyx":3408 + * """ + * check_flag_mask(flags) + * check_flag_mask(mask) # <<<<<<<<<<<<<< + * cmpfr.mpfr_flags_restore(flags, mask) + * + */ + __pyx_t_1 = __pyx_f_4mpfr_check_flag_mask(__pyx_v_mask); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 3408, __pyx_L1_error) + + /* "mpfr.pyx":3409 + * check_flag_mask(flags) + * check_flag_mask(mask) + * cmpfr.mpfr_flags_restore(flags, mask) # <<<<<<<<<<<<<< + * + * + */ + mpfr_flags_restore(__pyx_v_flags, __pyx_v_mask); + + /* "mpfr.pyx":3400 + * return cmpfr.mpfr_flags_save() + * + * def mpfr_flags_restore(cmpfr.mpfr_flags_t flags, cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Set the current flag state from an integer. + */ + + /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("mpfr.mpfr_flags_restore", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_tp_new_4mpfr_Mpz_t(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + #endif + if (unlikely(__pyx_pw_4mpfr_5Mpz_t_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad; + return o; + bad: + Py_DECREF(o); o = 0; + return NULL; +} + +static void __pyx_tp_dealloc_4mpfr_Mpz_t(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4mpfr_Mpz_t) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_4mpfr_5Mpz_t_3__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif +} + +static PyMethodDef __pyx_methods_4mpfr_Mpz_t[] = { + {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_5Mpz_t_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_5Mpz_t_4__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_5Mpz_t_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_5Mpz_t_6__setstate_cython__}, + {0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_4mpfr_Mpz_t_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4mpfr_Mpz_t}, + {Py_tp_doc, (void *)PyDoc_STR("\n GMP integer object.\n\n Mpz_t() creates a new, initialized GMP integer object with value 0.\n ")}, + {Py_tp_methods, (void *)__pyx_methods_4mpfr_Mpz_t}, + {Py_tp_new, (void *)__pyx_tp_new_4mpfr_Mpz_t}, + {0, 0}, +}; +static PyType_Spec __pyx_type_4mpfr_Mpz_t_spec = { + "mpfr.Mpz_t", + sizeof(struct __pyx_obj_4mpfr_Mpz_t), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, + __pyx_type_4mpfr_Mpz_t_slots, +}; +#else + +static PyTypeObject __pyx_type_4mpfr_Mpz_t = { + PyVarObject_HEAD_INIT(0, 0) + "mpfr.""Mpz_t", /*tp_name*/ + sizeof(struct __pyx_obj_4mpfr_Mpz_t), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4mpfr_Mpz_t, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + PyDoc_STR("\n GMP integer object.\n\n Mpz_t() creates a new, initialized GMP integer object with value 0.\n "), /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_4mpfr_Mpz_t, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4mpfr_Mpz_t, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyObject *__pyx_tp_new_4mpfr_Mpfr_t(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) { + o = (*t->tp_alloc)(t, 0); + } else { + o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); + } + if (unlikely(!o)) return 0; + #endif + return o; +} + +static void __pyx_tp_dealloc_4mpfr_Mpfr_t(PyObject *o) { + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_4mpfr_Mpfr_t) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); + __pyx_pw_4mpfr_6Mpfr_t_1__dealloc__(o); + __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); + PyErr_Restore(etype, eval, etb); + } + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif +} + +static PyMethodDef __pyx_methods_4mpfr_Mpfr_t[] = { + {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_6Mpfr_t_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_6Mpfr_t_2__reduce_cython__}, + {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_4mpfr_6Mpfr_t_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_4mpfr_6Mpfr_t_4__setstate_cython__}, + {0, 0, 0, 0} +}; +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_4mpfr_Mpfr_t_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_4mpfr_Mpfr_t}, + {Py_tp_doc, (void *)PyDoc_STR("\n Mutable arbitrary-precision binary floating-point numbers.\n\n Mpfr_t() -> new, uninitialized Mpfr object\n\n Mpfr_t() creates a new, uninitialized Mpfr_t object. This object must be\n initialized before use, for example by using the mpfr_init2 function.\n However, unlike the underlying MPFR library, it's not necessary to clear\n the object when it's no longer used.\n\n ")}, + {Py_tp_methods, (void *)__pyx_methods_4mpfr_Mpfr_t}, + {Py_tp_new, (void *)__pyx_tp_new_4mpfr_Mpfr_t}, + {0, 0}, +}; +static PyType_Spec __pyx_type_4mpfr_Mpfr_t_spec = { + "mpfr.Mpfr_t", + sizeof(struct __pyx_obj_4mpfr_Mpfr_t), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, + __pyx_type_4mpfr_Mpfr_t_slots, +}; +#else + +static PyTypeObject __pyx_type_4mpfr_Mpfr_t = { + PyVarObject_HEAD_INIT(0, 0) + "mpfr.""Mpfr_t", /*tp_name*/ + sizeof(struct __pyx_obj_4mpfr_Mpfr_t), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_4mpfr_Mpfr_t, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + #if PY_MAJOR_VERSION < 3 + 0, /*tp_compare*/ + #endif + #if PY_MAJOR_VERSION >= 3 + 0, /*tp_as_async*/ + #endif + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + PyDoc_STR("\n Mutable arbitrary-precision binary floating-point numbers.\n\n Mpfr_t() -> new, uninitialized Mpfr object\n\n Mpfr_t() creates a new, uninitialized Mpfr_t object. This object must be\n initialized before use, for example by using the mpfr_init2 function.\n However, unlike the underlying MPFR library, it's not necessary to clear\n the object when it's no longer used.\n\n "), /*tp_doc*/ + 0, /*tp_traverse*/ + 0, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_4mpfr_Mpfr_t, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_4mpfr_Mpfr_t, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + #if PY_VERSION_HEX >= 0x030400a1 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +static PyMethodDef __pyx_methods[] = { + {0, 0, 0, 0} +}; +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif +/* #### Code section: pystring_table ### */ + +static int __Pyx_CreateStringTabAndInitStrings(void) { + __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_u_Base_must_satisfy_2_base_62_or_2, __pyx_k_Base_must_satisfy_2_base_62_or_2, sizeof(__pyx_k_Base_must_satisfy_2_base_62_or_2), 0, 1, 0, 0}, + {&__pyx_kp_u_Cannot_convert_None_to_mpfr_Mpfr, __pyx_k_Cannot_convert_None_to_mpfr_Mpfr, sizeof(__pyx_k_Cannot_convert_None_to_mpfr_Mpfr), 0, 1, 0, 0}, + {&__pyx_n_s_DeprecationWarning, __pyx_k_DeprecationWarning, sizeof(__pyx_k_DeprecationWarning), 0, 0, 1, 1}, + {&__pyx_kp_u_Error_during_string_conversion, __pyx_k_Error_during_string_conversion, sizeof(__pyx_k_Error_during_string_conversion), 0, 1, 0, 0}, + {&__pyx_n_s_LONG_MAX, __pyx_k_LONG_MAX, sizeof(__pyx_k_LONG_MAX), 0, 0, 1, 1}, + {&__pyx_n_s_LONG_MIN, __pyx_k_LONG_MIN, sizeof(__pyx_k_LONG_MIN), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_EMAX_DEFAULT, __pyx_k_MPFR_EMAX_DEFAULT, sizeof(__pyx_k_MPFR_EMAX_DEFAULT), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_EMIN_DEFAULT, __pyx_k_MPFR_EMIN_DEFAULT, sizeof(__pyx_k_MPFR_EMIN_DEFAULT), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_FLAGS_ALL, __pyx_k_MPFR_FLAGS_ALL, sizeof(__pyx_k_MPFR_FLAGS_ALL), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_FLAGS_DIVBY0, __pyx_k_MPFR_FLAGS_DIVBY0, sizeof(__pyx_k_MPFR_FLAGS_DIVBY0), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_FLAGS_ERANGE, __pyx_k_MPFR_FLAGS_ERANGE, sizeof(__pyx_k_MPFR_FLAGS_ERANGE), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_FLAGS_INEXACT, __pyx_k_MPFR_FLAGS_INEXACT, sizeof(__pyx_k_MPFR_FLAGS_INEXACT), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_FLAGS_NAN, __pyx_k_MPFR_FLAGS_NAN, sizeof(__pyx_k_MPFR_FLAGS_NAN), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_FLAGS_OVERFLOW, __pyx_k_MPFR_FLAGS_OVERFLOW, sizeof(__pyx_k_MPFR_FLAGS_OVERFLOW), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_FLAGS_UNDERFLOW, __pyx_k_MPFR_FLAGS_UNDERFLOW, sizeof(__pyx_k_MPFR_FLAGS_UNDERFLOW), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_FREE_GLOBAL_CACHE, __pyx_k_MPFR_FREE_GLOBAL_CACHE, sizeof(__pyx_k_MPFR_FREE_GLOBAL_CACHE), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_FREE_LOCAL_CACHE, __pyx_k_MPFR_FREE_LOCAL_CACHE, sizeof(__pyx_k_MPFR_FREE_LOCAL_CACHE), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_PREC_MAX, __pyx_k_MPFR_PREC_MAX, sizeof(__pyx_k_MPFR_PREC_MAX), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_PREC_MIN, __pyx_k_MPFR_PREC_MIN, sizeof(__pyx_k_MPFR_PREC_MIN), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_RNDA, __pyx_k_MPFR_RNDA, sizeof(__pyx_k_MPFR_RNDA), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_RNDD, __pyx_k_MPFR_RNDD, sizeof(__pyx_k_MPFR_RNDD), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_RNDF, __pyx_k_MPFR_RNDF, sizeof(__pyx_k_MPFR_RNDF), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_RNDN, __pyx_k_MPFR_RNDN, sizeof(__pyx_k_MPFR_RNDN), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_RNDU, __pyx_k_MPFR_RNDU, sizeof(__pyx_k_MPFR_RNDU), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_RNDZ, __pyx_k_MPFR_RNDZ, sizeof(__pyx_k_MPFR_RNDZ), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_VERSION, __pyx_k_MPFR_VERSION, sizeof(__pyx_k_MPFR_VERSION), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_VERSION_MAJOR, __pyx_k_MPFR_VERSION_MAJOR, sizeof(__pyx_k_MPFR_VERSION_MAJOR), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_VERSION_MINOR, __pyx_k_MPFR_VERSION_MINOR, sizeof(__pyx_k_MPFR_VERSION_MINOR), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_VERSION_NUM, __pyx_k_MPFR_VERSION_NUM, sizeof(__pyx_k_MPFR_VERSION_NUM), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_VERSION_PATCHLEVEL, __pyx_k_MPFR_VERSION_PATCHLEVEL, sizeof(__pyx_k_MPFR_VERSION_PATCHLEVEL), 0, 0, 1, 1}, + {&__pyx_n_s_MPFR_VERSION_STRING, __pyx_k_MPFR_VERSION_STRING, sizeof(__pyx_k_MPFR_VERSION_STRING), 0, 0, 1, 1}, + {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1}, + {&__pyx_n_s_Mpfr_t, __pyx_k_Mpfr_t, sizeof(__pyx_k_Mpfr_t), 0, 0, 1, 1}, + {&__pyx_n_s_Mpfr_t___reduce_cython, __pyx_k_Mpfr_t___reduce_cython, sizeof(__pyx_k_Mpfr_t___reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_Mpfr_t___setstate_cython, __pyx_k_Mpfr_t___setstate_cython, sizeof(__pyx_k_Mpfr_t___setstate_cython), 0, 0, 1, 1}, + {&__pyx_kp_u_Mpfr_t_instance_is_already_initi, __pyx_k_Mpfr_t_instance_is_already_initi, sizeof(__pyx_k_Mpfr_t_instance_is_already_initi), 0, 1, 0, 0}, + {&__pyx_kp_u_Mpfr_t_instance_should_be_initia, __pyx_k_Mpfr_t_instance_should_be_initia, sizeof(__pyx_k_Mpfr_t_instance_should_be_initia), 0, 1, 0, 0}, + {&__pyx_n_s_Mpz_t, __pyx_k_Mpz_t, sizeof(__pyx_k_Mpz_t), 0, 0, 1, 1}, + {&__pyx_n_s_Mpz_t___reduce_cython, __pyx_k_Mpz_t___reduce_cython, sizeof(__pyx_k_Mpz_t___reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_Mpz_t___setstate_cython, __pyx_k_Mpz_t___setstate_cython, sizeof(__pyx_k_Mpz_t___setstate_cython), 0, 0, 1, 1}, + {&__pyx_kp_u_Not_a_valid_number_for_base, __pyx_k_Not_a_valid_number_for_base, sizeof(__pyx_k_Not_a_valid_number_for_base), 0, 1, 0, 0}, + {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, + {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, + {&__pyx_n_s_ULONG_MAX, __pyx_k_ULONG_MAX, sizeof(__pyx_k_ULONG_MAX), 0, 0, 1, 1}, + {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, + {&__pyx_n_s__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 1, 1}, + {&__pyx_n_s__283, __pyx_k__283, sizeof(__pyx_k__283), 0, 0, 1, 1}, + {&__pyx_n_s_arg, __pyx_k_arg, sizeof(__pyx_k_arg), 0, 0, 1, 1}, + {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, + {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1}, + {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1}, + {&__pyx_kp_u_base_must_satisfy_2_base_62_or_b, __pyx_k_base_must_satisfy_2_base_62_or_b, sizeof(__pyx_k_base_must_satisfy_2_base_62_or_b), 0, 1, 0, 0}, + {&__pyx_kp_u_base_should_be_in_the_range_2_to, __pyx_k_base_should_be_in_the_range_2_to, sizeof(__pyx_k_base_should_be_in_the_range_2_to), 0, 1, 0, 0}, + {&__pyx_kp_u_base_should_be_zero_or_in_the_ra, __pyx_k_base_should_be_zero_or_in_the_ra, sizeof(__pyx_k_base_should_be_zero_or_in_the_ra), 0, 1, 0, 0}, + {&__pyx_n_s_bytes_s, __pyx_k_bytes_s, sizeof(__pyx_k_bytes_s), 0, 0, 1, 1}, + {&__pyx_n_s_c_digits, __pyx_k_c_digits, sizeof(__pyx_k_c_digits), 0, 0, 1, 1}, + {&__pyx_n_s_c_digits_alloc, __pyx_k_c_digits_alloc, sizeof(__pyx_k_c_digits_alloc), 0, 0, 1, 1}, + {&__pyx_n_s_c_digits_len, __pyx_k_c_digits_len, sizeof(__pyx_k_c_digits_len), 0, 0, 1, 1}, + {&__pyx_n_s_category, __pyx_k_category, sizeof(__pyx_k_category), 0, 0, 1, 1}, + {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_cop, __pyx_k_cop, sizeof(__pyx_k_cop), 0, 0, 1, 1}, + {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, + {&__pyx_n_s_digits, __pyx_k_digits, sizeof(__pyx_k_digits), 0, 0, 1, 1}, + {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0}, + {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1}, + {&__pyx_n_s_elt, __pyx_k_elt, sizeof(__pyx_k_elt), 0, 0, 1, 1}, + {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, + {&__pyx_n_s_endindex, __pyx_k_endindex, sizeof(__pyx_k_endindex), 0, 0, 1, 1}, + {&__pyx_n_s_endptr, __pyx_k_endptr, sizeof(__pyx_k_endptr), 0, 0, 1, 1}, + {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, + {&__pyx_n_s_error_code, __pyx_k_error_code, sizeof(__pyx_k_error_code), 0, 0, 1, 1}, + {&__pyx_n_s_exp, __pyx_k_exp, sizeof(__pyx_k_exp), 0, 0, 1, 1}, + {&__pyx_n_s_exponent, __pyx_k_exponent, sizeof(__pyx_k_exponent), 0, 0, 1, 1}, + {&__pyx_kp_u_exponent_not_in_current_exponent, __pyx_k_exponent_not_in_current_exponent, sizeof(__pyx_k_exponent_not_in_current_exponent), 0, 1, 0, 0}, + {&__pyx_kp_u_flag_mask_contains_invalid_flags, __pyx_k_flag_mask_contains_invalid_flags, sizeof(__pyx_k_flag_mask_contains_invalid_flags), 0, 1, 0, 0}, + {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, + {&__pyx_n_s_fop, __pyx_k_fop, sizeof(__pyx_k_fop), 0, 0, 1, 1}, + {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, + {&__pyx_n_s_freefunc, __pyx_k_freefunc, sizeof(__pyx_k_freefunc), 0, 0, 1, 1}, + {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, + {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, + {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, + {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, + {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1}, + {&__pyx_kp_u_invalid_flag_mask, __pyx_k_invalid_flag_mask, sizeof(__pyx_k_invalid_flag_mask), 0, 1, 0, 0}, + {&__pyx_kp_u_invalid_rounding_mode, __pyx_k_invalid_rounding_mode, sizeof(__pyx_k_invalid_rounding_mode), 0, 1, 0, 0}, + {&__pyx_n_s_iop, __pyx_k_iop, sizeof(__pyx_k_iop), 0, 0, 1, 1}, + {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1}, + {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0}, + {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1}, + {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, + {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1}, + {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1}, + {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr, __pyx_k_mpfr, sizeof(__pyx_k_mpfr), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_abs, __pyx_k_mpfr_abs, sizeof(__pyx_k_mpfr_abs), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_acos, __pyx_k_mpfr_acos, sizeof(__pyx_k_mpfr_acos), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_acosh, __pyx_k_mpfr_acosh, sizeof(__pyx_k_mpfr_acosh), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_add, __pyx_k_mpfr_add, sizeof(__pyx_k_mpfr_add), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_agm, __pyx_k_mpfr_agm, sizeof(__pyx_k_mpfr_agm), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_ai, __pyx_k_mpfr_ai, sizeof(__pyx_k_mpfr_ai), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_asin, __pyx_k_mpfr_asin, sizeof(__pyx_k_mpfr_asin), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_asinh, __pyx_k_mpfr_asinh, sizeof(__pyx_k_mpfr_asinh), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_asprintf, __pyx_k_mpfr_asprintf, sizeof(__pyx_k_mpfr_asprintf), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_atan, __pyx_k_mpfr_atan, sizeof(__pyx_k_mpfr_atan), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_atan2, __pyx_k_mpfr_atan2, sizeof(__pyx_k_mpfr_atan2), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_atanh, __pyx_k_mpfr_atanh, sizeof(__pyx_k_mpfr_atanh), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_beta, __pyx_k_mpfr_beta, sizeof(__pyx_k_mpfr_beta), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_buildopt_decimal_p, __pyx_k_mpfr_buildopt_decimal_p, sizeof(__pyx_k_mpfr_buildopt_decimal_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_buildopt_float128_p, __pyx_k_mpfr_buildopt_float128_p, sizeof(__pyx_k_mpfr_buildopt_float128_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_buildopt_gmpinternals_p, __pyx_k_mpfr_buildopt_gmpinternals_p, sizeof(__pyx_k_mpfr_buildopt_gmpinternals_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_buildopt_sharedcache_p, __pyx_k_mpfr_buildopt_sharedcache_p, sizeof(__pyx_k_mpfr_buildopt_sharedcache_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_buildopt_tls_p, __pyx_k_mpfr_buildopt_tls_p, sizeof(__pyx_k_mpfr_buildopt_tls_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_buildopt_tune_case, __pyx_k_mpfr_buildopt_tune_case, sizeof(__pyx_k_mpfr_buildopt_tune_case), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_can_round, __pyx_k_mpfr_can_round, sizeof(__pyx_k_mpfr_can_round), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_cbrt, __pyx_k_mpfr_cbrt, sizeof(__pyx_k_mpfr_cbrt), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_ceil, __pyx_k_mpfr_ceil, sizeof(__pyx_k_mpfr_ceil), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_check_range, __pyx_k_mpfr_check_range, sizeof(__pyx_k_mpfr_check_range), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_clear, __pyx_k_mpfr_clear, sizeof(__pyx_k_mpfr_clear), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_clear_divby0, __pyx_k_mpfr_clear_divby0, sizeof(__pyx_k_mpfr_clear_divby0), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_clear_erangeflag, __pyx_k_mpfr_clear_erangeflag, sizeof(__pyx_k_mpfr_clear_erangeflag), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_clear_flags, __pyx_k_mpfr_clear_flags, sizeof(__pyx_k_mpfr_clear_flags), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_clear_inexflag, __pyx_k_mpfr_clear_inexflag, sizeof(__pyx_k_mpfr_clear_inexflag), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_clear_nanflag, __pyx_k_mpfr_clear_nanflag, sizeof(__pyx_k_mpfr_clear_nanflag), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_clear_overflow, __pyx_k_mpfr_clear_overflow, sizeof(__pyx_k_mpfr_clear_overflow), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_clear_underflow, __pyx_k_mpfr_clear_underflow, sizeof(__pyx_k_mpfr_clear_underflow), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_clears, __pyx_k_mpfr_clears, sizeof(__pyx_k_mpfr_clears), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_cmp, __pyx_k_mpfr_cmp, sizeof(__pyx_k_mpfr_cmp), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_cmpabs, __pyx_k_mpfr_cmpabs, sizeof(__pyx_k_mpfr_cmpabs), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_const_catalan, __pyx_k_mpfr_const_catalan, sizeof(__pyx_k_mpfr_const_catalan), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_const_euler, __pyx_k_mpfr_const_euler, sizeof(__pyx_k_mpfr_const_euler), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_const_log2, __pyx_k_mpfr_const_log2, sizeof(__pyx_k_mpfr_const_log2), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_const_pi, __pyx_k_mpfr_const_pi, sizeof(__pyx_k_mpfr_const_pi), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_copysign, __pyx_k_mpfr_copysign, sizeof(__pyx_k_mpfr_copysign), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_cos, __pyx_k_mpfr_cos, sizeof(__pyx_k_mpfr_cos), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_cosh, __pyx_k_mpfr_cosh, sizeof(__pyx_k_mpfr_cosh), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_cot, __pyx_k_mpfr_cot, sizeof(__pyx_k_mpfr_cot), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_coth, __pyx_k_mpfr_coth, sizeof(__pyx_k_mpfr_coth), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_csc, __pyx_k_mpfr_csc, sizeof(__pyx_k_mpfr_csc), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_csch, __pyx_k_mpfr_csch, sizeof(__pyx_k_mpfr_csch), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_digamma, __pyx_k_mpfr_digamma, sizeof(__pyx_k_mpfr_digamma), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_dim, __pyx_k_mpfr_dim, sizeof(__pyx_k_mpfr_dim), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_div, __pyx_k_mpfr_div, sizeof(__pyx_k_mpfr_div), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_divby0_p, __pyx_k_mpfr_divby0_p, sizeof(__pyx_k_mpfr_divby0_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_eint, __pyx_k_mpfr_eint, sizeof(__pyx_k_mpfr_eint), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_equal_p, __pyx_k_mpfr_equal_p, sizeof(__pyx_k_mpfr_equal_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_erangeflag_p, __pyx_k_mpfr_erangeflag_p, sizeof(__pyx_k_mpfr_erangeflag_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_erf, __pyx_k_mpfr_erf, sizeof(__pyx_k_mpfr_erf), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_erfc, __pyx_k_mpfr_erfc, sizeof(__pyx_k_mpfr_erfc), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_exp, __pyx_k_mpfr_exp, sizeof(__pyx_k_mpfr_exp), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_exp10, __pyx_k_mpfr_exp10, sizeof(__pyx_k_mpfr_exp10), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_exp2, __pyx_k_mpfr_exp2, sizeof(__pyx_k_mpfr_exp2), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_expm1, __pyx_k_mpfr_expm1, sizeof(__pyx_k_mpfr_expm1), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_fac_ui, __pyx_k_mpfr_fac_ui, sizeof(__pyx_k_mpfr_fac_ui), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_fits_slong_p, __pyx_k_mpfr_fits_slong_p, sizeof(__pyx_k_mpfr_fits_slong_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_fits_ulong_p, __pyx_k_mpfr_fits_ulong_p, sizeof(__pyx_k_mpfr_fits_ulong_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_flags_clear, __pyx_k_mpfr_flags_clear, sizeof(__pyx_k_mpfr_flags_clear), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_flags_restore, __pyx_k_mpfr_flags_restore, sizeof(__pyx_k_mpfr_flags_restore), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_flags_save, __pyx_k_mpfr_flags_save, sizeof(__pyx_k_mpfr_flags_save), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_flags_set, __pyx_k_mpfr_flags_set, sizeof(__pyx_k_mpfr_flags_set), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_flags_test, __pyx_k_mpfr_flags_test, sizeof(__pyx_k_mpfr_flags_test), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_floor, __pyx_k_mpfr_floor, sizeof(__pyx_k_mpfr_floor), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_fma, __pyx_k_mpfr_fma, sizeof(__pyx_k_mpfr_fma), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_fmma, __pyx_k_mpfr_fmma, sizeof(__pyx_k_mpfr_fmma), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_fmms, __pyx_k_mpfr_fmms, sizeof(__pyx_k_mpfr_fmms), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_fmod, __pyx_k_mpfr_fmod, sizeof(__pyx_k_mpfr_fmod), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_fmodquo, __pyx_k_mpfr_fmodquo, sizeof(__pyx_k_mpfr_fmodquo), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_fms, __pyx_k_mpfr_fms, sizeof(__pyx_k_mpfr_fms), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_frac, __pyx_k_mpfr_frac, sizeof(__pyx_k_mpfr_frac), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_free_cache, __pyx_k_mpfr_free_cache, sizeof(__pyx_k_mpfr_free_cache), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_free_cache2, __pyx_k_mpfr_free_cache2, sizeof(__pyx_k_mpfr_free_cache2), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_free_pool, __pyx_k_mpfr_free_pool, sizeof(__pyx_k_mpfr_free_pool), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_frexp, __pyx_k_mpfr_frexp, sizeof(__pyx_k_mpfr_frexp), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_gamma, __pyx_k_mpfr_gamma, sizeof(__pyx_k_mpfr_gamma), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_gamma_inc, __pyx_k_mpfr_gamma_inc, sizeof(__pyx_k_mpfr_gamma_inc), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_d, __pyx_k_mpfr_get_d, sizeof(__pyx_k_mpfr_get_d), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_d_2exp, __pyx_k_mpfr_get_d_2exp, sizeof(__pyx_k_mpfr_get_d_2exp), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_default_prec, __pyx_k_mpfr_get_default_prec, sizeof(__pyx_k_mpfr_get_default_prec), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_default_rounding_mode, __pyx_k_mpfr_get_default_rounding_mode, sizeof(__pyx_k_mpfr_get_default_rounding_mode), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_emax, __pyx_k_mpfr_get_emax, sizeof(__pyx_k_mpfr_get_emax), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_emax_max, __pyx_k_mpfr_get_emax_max, sizeof(__pyx_k_mpfr_get_emax_max), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_emax_min, __pyx_k_mpfr_get_emax_min, sizeof(__pyx_k_mpfr_get_emax_min), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_emin, __pyx_k_mpfr_get_emin, sizeof(__pyx_k_mpfr_get_emin), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_emin_max, __pyx_k_mpfr_get_emin_max, sizeof(__pyx_k_mpfr_get_emin_max), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_emin_min, __pyx_k_mpfr_get_emin_min, sizeof(__pyx_k_mpfr_get_emin_min), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_exp, __pyx_k_mpfr_get_exp, sizeof(__pyx_k_mpfr_get_exp), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_patches, __pyx_k_mpfr_get_patches, sizeof(__pyx_k_mpfr_get_patches), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_prec, __pyx_k_mpfr_get_prec, sizeof(__pyx_k_mpfr_get_prec), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_si, __pyx_k_mpfr_get_si, sizeof(__pyx_k_mpfr_get_si), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_str, __pyx_k_mpfr_get_str, sizeof(__pyx_k_mpfr_get_str), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_ui, __pyx_k_mpfr_get_ui, sizeof(__pyx_k_mpfr_get_ui), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_version, __pyx_k_mpfr_get_version, sizeof(__pyx_k_mpfr_get_version), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_z, __pyx_k_mpfr_get_z, sizeof(__pyx_k_mpfr_get_z), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_get_z_2exp, __pyx_k_mpfr_get_z_2exp, sizeof(__pyx_k_mpfr_get_z_2exp), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_greater_p, __pyx_k_mpfr_greater_p, sizeof(__pyx_k_mpfr_greater_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_greaterequal_p, __pyx_k_mpfr_greaterequal_p, sizeof(__pyx_k_mpfr_greaterequal_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_hypot, __pyx_k_mpfr_hypot, sizeof(__pyx_k_mpfr_hypot), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_inexflag_p, __pyx_k_mpfr_inexflag_p, sizeof(__pyx_k_mpfr_inexflag_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_inf_p, __pyx_k_mpfr_inf_p, sizeof(__pyx_k_mpfr_inf_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_init, __pyx_k_mpfr_init, sizeof(__pyx_k_mpfr_init), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_init2, __pyx_k_mpfr_init2, sizeof(__pyx_k_mpfr_init2), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_initialized_p, __pyx_k_mpfr_initialized_p, sizeof(__pyx_k_mpfr_initialized_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_inits, __pyx_k_mpfr_inits, sizeof(__pyx_k_mpfr_inits), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_inits2, __pyx_k_mpfr_inits2, sizeof(__pyx_k_mpfr_inits2), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_integer_p, __pyx_k_mpfr_integer_p, sizeof(__pyx_k_mpfr_integer_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_j0, __pyx_k_mpfr_j0, sizeof(__pyx_k_mpfr_j0), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_j1, __pyx_k_mpfr_j1, sizeof(__pyx_k_mpfr_j1), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_jn, __pyx_k_mpfr_jn, sizeof(__pyx_k_mpfr_jn), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_less_p, __pyx_k_mpfr_less_p, sizeof(__pyx_k_mpfr_less_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_lessequal_p, __pyx_k_mpfr_lessequal_p, sizeof(__pyx_k_mpfr_lessequal_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_lessgreater_p, __pyx_k_mpfr_lessgreater_p, sizeof(__pyx_k_mpfr_lessgreater_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_lgamma, __pyx_k_mpfr_lgamma, sizeof(__pyx_k_mpfr_lgamma), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_li2, __pyx_k_mpfr_li2, sizeof(__pyx_k_mpfr_li2), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_lngamma, __pyx_k_mpfr_lngamma, sizeof(__pyx_k_mpfr_lngamma), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_log, __pyx_k_mpfr_log, sizeof(__pyx_k_mpfr_log), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_log10, __pyx_k_mpfr_log10, sizeof(__pyx_k_mpfr_log10), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_log1p, __pyx_k_mpfr_log1p, sizeof(__pyx_k_mpfr_log1p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_log2, __pyx_k_mpfr_log2, sizeof(__pyx_k_mpfr_log2), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_log_ui, __pyx_k_mpfr_log_ui, sizeof(__pyx_k_mpfr_log_ui), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_max, __pyx_k_mpfr_max, sizeof(__pyx_k_mpfr_max), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_min, __pyx_k_mpfr_min, sizeof(__pyx_k_mpfr_min), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_min_prec, __pyx_k_mpfr_min_prec, sizeof(__pyx_k_mpfr_min_prec), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_modf, __pyx_k_mpfr_modf, sizeof(__pyx_k_mpfr_modf), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_mp_memory_cleanup, __pyx_k_mpfr_mp_memory_cleanup, sizeof(__pyx_k_mpfr_mp_memory_cleanup), 0, 0, 1, 1}, + {&__pyx_kp_u_mpfr_mp_memory_cleanup_returned, __pyx_k_mpfr_mp_memory_cleanup_returned, sizeof(__pyx_k_mpfr_mp_memory_cleanup_returned), 0, 1, 0, 0}, + {&__pyx_n_s_mpfr_mul, __pyx_k_mpfr_mul, sizeof(__pyx_k_mpfr_mul), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_nan_p, __pyx_k_mpfr_nan_p, sizeof(__pyx_k_mpfr_nan_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_nanflag_p, __pyx_k_mpfr_nanflag_p, sizeof(__pyx_k_mpfr_nanflag_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_neg, __pyx_k_mpfr_neg, sizeof(__pyx_k_mpfr_neg), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_nextabove, __pyx_k_mpfr_nextabove, sizeof(__pyx_k_mpfr_nextabove), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_nextbelow, __pyx_k_mpfr_nextbelow, sizeof(__pyx_k_mpfr_nextbelow), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_nexttoward, __pyx_k_mpfr_nexttoward, sizeof(__pyx_k_mpfr_nexttoward), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_number_p, __pyx_k_mpfr_number_p, sizeof(__pyx_k_mpfr_number_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_overflow_p, __pyx_k_mpfr_overflow_p, sizeof(__pyx_k_mpfr_overflow_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_pow, __pyx_k_mpfr_pow, sizeof(__pyx_k_mpfr_pow), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_prec_round, __pyx_k_mpfr_prec_round, sizeof(__pyx_k_mpfr_prec_round), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_print_rnd_mode, __pyx_k_mpfr_print_rnd_mode, sizeof(__pyx_k_mpfr_print_rnd_mode), 0, 0, 1, 1}, + {&__pyx_kp_s_mpfr_pyx, __pyx_k_mpfr_pyx, sizeof(__pyx_k_mpfr_pyx), 0, 0, 1, 0}, + {&__pyx_n_s_mpfr_rec_sqrt, __pyx_k_mpfr_rec_sqrt, sizeof(__pyx_k_mpfr_rec_sqrt), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_regular_p, __pyx_k_mpfr_regular_p, sizeof(__pyx_k_mpfr_regular_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_remainder, __pyx_k_mpfr_remainder, sizeof(__pyx_k_mpfr_remainder), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_remquo, __pyx_k_mpfr_remquo, sizeof(__pyx_k_mpfr_remquo), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_rint, __pyx_k_mpfr_rint, sizeof(__pyx_k_mpfr_rint), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_rint_ceil, __pyx_k_mpfr_rint_ceil, sizeof(__pyx_k_mpfr_rint_ceil), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_rint_floor, __pyx_k_mpfr_rint_floor, sizeof(__pyx_k_mpfr_rint_floor), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_rint_round, __pyx_k_mpfr_rint_round, sizeof(__pyx_k_mpfr_rint_round), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_rint_roundeven, __pyx_k_mpfr_rint_roundeven, sizeof(__pyx_k_mpfr_rint_roundeven), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_rint_trunc, __pyx_k_mpfr_rint_trunc, sizeof(__pyx_k_mpfr_rint_trunc), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_root, __pyx_k_mpfr_root, sizeof(__pyx_k_mpfr_root), 0, 0, 1, 1}, + {&__pyx_kp_u_mpfr_root_is_deprecated_Use_mpfr, __pyx_k_mpfr_root_is_deprecated_Use_mpfr, sizeof(__pyx_k_mpfr_root_is_deprecated_Use_mpfr), 0, 1, 0, 0}, + {&__pyx_n_s_mpfr_root_no_warn, __pyx_k_mpfr_root_no_warn, sizeof(__pyx_k_mpfr_root_no_warn), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_rootn_ui, __pyx_k_mpfr_rootn_ui, sizeof(__pyx_k_mpfr_rootn_ui), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_round, __pyx_k_mpfr_round, sizeof(__pyx_k_mpfr_round), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_roundeven, __pyx_k_mpfr_roundeven, sizeof(__pyx_k_mpfr_roundeven), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_sec, __pyx_k_mpfr_sec, sizeof(__pyx_k_mpfr_sec), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_sech, __pyx_k_mpfr_sech, sizeof(__pyx_k_mpfr_sech), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set, __pyx_k_mpfr_set, sizeof(__pyx_k_mpfr_set), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_d, __pyx_k_mpfr_set_d, sizeof(__pyx_k_mpfr_set_d), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_default_prec, __pyx_k_mpfr_set_default_prec, sizeof(__pyx_k_mpfr_set_default_prec), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_default_rounding_mode, __pyx_k_mpfr_set_default_rounding_mode, sizeof(__pyx_k_mpfr_set_default_rounding_mode), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_divby0, __pyx_k_mpfr_set_divby0, sizeof(__pyx_k_mpfr_set_divby0), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_emax, __pyx_k_mpfr_set_emax, sizeof(__pyx_k_mpfr_set_emax), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_emin, __pyx_k_mpfr_set_emin, sizeof(__pyx_k_mpfr_set_emin), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_erangeflag, __pyx_k_mpfr_set_erangeflag, sizeof(__pyx_k_mpfr_set_erangeflag), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_exp, __pyx_k_mpfr_set_exp, sizeof(__pyx_k_mpfr_set_exp), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_inexflag, __pyx_k_mpfr_set_inexflag, sizeof(__pyx_k_mpfr_set_inexflag), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_inf, __pyx_k_mpfr_set_inf, sizeof(__pyx_k_mpfr_set_inf), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_nan, __pyx_k_mpfr_set_nan, sizeof(__pyx_k_mpfr_set_nan), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_nanflag, __pyx_k_mpfr_set_nanflag, sizeof(__pyx_k_mpfr_set_nanflag), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_overflow, __pyx_k_mpfr_set_overflow, sizeof(__pyx_k_mpfr_set_overflow), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_prec, __pyx_k_mpfr_set_prec, sizeof(__pyx_k_mpfr_set_prec), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_si, __pyx_k_mpfr_set_si, sizeof(__pyx_k_mpfr_set_si), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_si_2exp, __pyx_k_mpfr_set_si_2exp, sizeof(__pyx_k_mpfr_set_si_2exp), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_str, __pyx_k_mpfr_set_str, sizeof(__pyx_k_mpfr_set_str), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_ui, __pyx_k_mpfr_set_ui, sizeof(__pyx_k_mpfr_set_ui), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_ui_2exp, __pyx_k_mpfr_set_ui_2exp, sizeof(__pyx_k_mpfr_set_ui_2exp), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_underflow, __pyx_k_mpfr_set_underflow, sizeof(__pyx_k_mpfr_set_underflow), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_z, __pyx_k_mpfr_set_z, sizeof(__pyx_k_mpfr_set_z), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_z_2exp, __pyx_k_mpfr_set_z_2exp, sizeof(__pyx_k_mpfr_set_z_2exp), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_set_zero, __pyx_k_mpfr_set_zero, sizeof(__pyx_k_mpfr_set_zero), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_setsign, __pyx_k_mpfr_setsign, sizeof(__pyx_k_mpfr_setsign), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_sgn, __pyx_k_mpfr_sgn, sizeof(__pyx_k_mpfr_sgn), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_signbit, __pyx_k_mpfr_signbit, sizeof(__pyx_k_mpfr_signbit), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_sin, __pyx_k_mpfr_sin, sizeof(__pyx_k_mpfr_sin), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_sin_cos, __pyx_k_mpfr_sin_cos, sizeof(__pyx_k_mpfr_sin_cos), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_sinh, __pyx_k_mpfr_sinh, sizeof(__pyx_k_mpfr_sinh), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_sinh_cosh, __pyx_k_mpfr_sinh_cosh, sizeof(__pyx_k_mpfr_sinh_cosh), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_sqr, __pyx_k_mpfr_sqr, sizeof(__pyx_k_mpfr_sqr), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_sqrt, __pyx_k_mpfr_sqrt, sizeof(__pyx_k_mpfr_sqrt), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_strtofr, __pyx_k_mpfr_strtofr, sizeof(__pyx_k_mpfr_strtofr), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_sub, __pyx_k_mpfr_sub, sizeof(__pyx_k_mpfr_sub), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_subnormalize, __pyx_k_mpfr_subnormalize, sizeof(__pyx_k_mpfr_subnormalize), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_sum, __pyx_k_mpfr_sum, sizeof(__pyx_k_mpfr_sum), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_swap, __pyx_k_mpfr_swap, sizeof(__pyx_k_mpfr_swap), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_tan, __pyx_k_mpfr_tan, sizeof(__pyx_k_mpfr_tan), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_tanh, __pyx_k_mpfr_tanh, sizeof(__pyx_k_mpfr_tanh), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_trunc, __pyx_k_mpfr_trunc, sizeof(__pyx_k_mpfr_trunc), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_underflow_p, __pyx_k_mpfr_underflow_p, sizeof(__pyx_k_mpfr_underflow_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_unordered_p, __pyx_k_mpfr_unordered_p, sizeof(__pyx_k_mpfr_unordered_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_y0, __pyx_k_mpfr_y0, sizeof(__pyx_k_mpfr_y0), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_y1, __pyx_k_mpfr_y1, sizeof(__pyx_k_mpfr_y1), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_yn, __pyx_k_mpfr_yn, sizeof(__pyx_k_mpfr_yn), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_zero_p, __pyx_k_mpfr_zero_p, sizeof(__pyx_k_mpfr_zero_p), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_zeta, __pyx_k_mpfr_zeta, sizeof(__pyx_k_mpfr_zeta), 0, 0, 1, 1}, + {&__pyx_n_s_mpfr_zeta_ui, __pyx_k_mpfr_zeta_ui, sizeof(__pyx_k_mpfr_zeta_ui), 0, 0, 1, 1}, + {&__pyx_n_s_mpz_get_str, __pyx_k_mpz_get_str, sizeof(__pyx_k_mpz_get_str), 0, 0, 1, 1}, + {&__pyx_n_s_mpz_set_str, __pyx_k_mpz_set_str, sizeof(__pyx_k_mpz_set_str), 0, 0, 1, 1}, + {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, + {&__pyx_kp_u_n_should_be_either_0_or_at_least, __pyx_k_n_should_be_either_0_or_at_least, sizeof(__pyx_k_n_should_be_either_0_or_at_least), 0, 1, 0, 0}, + {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_kp_u_new_exponent_for_emin_is_outside, __pyx_k_new_exponent_for_emin_is_outside, sizeof(__pyx_k_new_exponent_for_emin_is_outside), 0, 1, 0, 0}, + {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, + {&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1}, + {&__pyx_n_s_op1, __pyx_k_op1, sizeof(__pyx_k_op1), 0, 0, 1, 1}, + {&__pyx_n_s_op2, __pyx_k_op2, sizeof(__pyx_k_op2), 0, 0, 1, 1}, + {&__pyx_n_s_op3, __pyx_k_op3, sizeof(__pyx_k_op3), 0, 0, 1, 1}, + {&__pyx_n_s_op4, __pyx_k_op4, sizeof(__pyx_k_op4), 0, 0, 1, 1}, + {&__pyx_n_s_output, __pyx_k_output, sizeof(__pyx_k_output), 0, 0, 1, 1}, + {&__pyx_n_s_output_as_bytes, __pyx_k_output_as_bytes, sizeof(__pyx_k_output_as_bytes), 0, 0, 1, 1}, + {&__pyx_n_s_patches, __pyx_k_patches, sizeof(__pyx_k_patches), 0, 0, 1, 1}, + {&__pyx_n_s_patchlevel, __pyx_k_patchlevel, sizeof(__pyx_k_patchlevel), 0, 0, 1, 1}, + {&__pyx_n_s_pointers, __pyx_k_pointers, sizeof(__pyx_k_pointers), 0, 0, 1, 1}, + {&__pyx_n_s_prec, __pyx_k_prec, sizeof(__pyx_k_prec), 0, 0, 1, 1}, + {&__pyx_kp_u_precision_should_be_between_and, __pyx_k_precision_should_be_between_and, sizeof(__pyx_k_precision_should_be_between_and), 0, 1, 0, 0}, + {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, + {&__pyx_n_s_quotient, __pyx_k_quotient, sizeof(__pyx_k_quotient), 0, 0, 1, 1}, + {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, + {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1}, + {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, + {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, + {&__pyx_n_s_rnd, __pyx_k_rnd, sizeof(__pyx_k_rnd), 0, 0, 1, 1}, + {&__pyx_n_s_rnd1, __pyx_k_rnd1, sizeof(__pyx_k_rnd1), 0, 0, 1, 1}, + {&__pyx_n_s_rnd2, __pyx_k_rnd2, sizeof(__pyx_k_rnd2), 0, 0, 1, 1}, + {&__pyx_n_s_rop, __pyx_k_rop, sizeof(__pyx_k_rop), 0, 0, 1, 1}, + {&__pyx_n_s_rounding_mode, __pyx_k_rounding_mode, sizeof(__pyx_k_rounding_mode), 0, 0, 1, 1}, + {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1}, + {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, + {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, + {&__pyx_kp_s_self__value_cannot_be_converted, __pyx_k_self__value_cannot_be_converted, sizeof(__pyx_k_self__value_cannot_be_converted), 0, 0, 1, 0}, + {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, + {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, + {&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1}, + {&__pyx_n_s_signp, __pyx_k_signp, sizeof(__pyx_k_signp), 0, 0, 1, 1}, + {&__pyx_n_s_sop, __pyx_k_sop, sizeof(__pyx_k_sop), 0, 0, 1, 1}, + {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, + {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, + {&__pyx_n_s_startptr, __pyx_k_startptr, sizeof(__pyx_k_startptr), 0, 0, 1, 1}, + {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, + {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, + {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1}, + {&__pyx_n_s_tab, __pyx_k_tab, sizeof(__pyx_k_tab), 0, 0, 1, 1}, + {&__pyx_n_s_template, __pyx_k_template, sizeof(__pyx_k_template), 0, 0, 1, 1}, + {&__pyx_n_s_template_bytes, __pyx_k_template_bytes, sizeof(__pyx_k_template_bytes), 0, 0, 1, 1}, + {&__pyx_n_s_ternary, __pyx_k_ternary, sizeof(__pyx_k_ternary), 0, 0, 1, 1}, + {&__pyx_n_s_ternary_pair, __pyx_k_ternary_pair, sizeof(__pyx_k_ternary_pair), 0, 0, 1, 1}, + {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, + {&__pyx_n_s_thresholds, __pyx_k_thresholds, sizeof(__pyx_k_thresholds), 0, 0, 1, 1}, + {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, + {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1}, + {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1}, + {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1}, + {&__pyx_n_s_way, __pyx_k_way, sizeof(__pyx_k_way), 0, 0, 1, 1}, + {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, + {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, + {0, 0, 0, 0, 0, 0, 0} + }; + return __Pyx_InitStrings(__pyx_string_tab); +} +/* #### Code section: cached_builtins ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 77, __pyx_L1_error) + __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 113, __pyx_L1_error) + __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) __PYX_ERR(1, 1104, __pyx_L1_error) + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 2260, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 2296, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + + /* "mpfr.pyx":77 + * + * if not (2 <= base <= 62 or base == 0): + * raise ValueError("base must satisfy 2 <= base <= 62 or base == 0") # <<<<<<<<<<<<<< + * + * bytes_s = s.encode('ascii') + */ + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_base_must_satisfy_2_base_62_or_b); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 77, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); + + /* "mpfr.pyx":105 + * + * if not (2 <= base <= 62 or -36 <= base <= -2): + * raise ValueError( # <<<<<<<<<<<<<< + * "Base must satisfy 2 <= base <= 62 or -2 >= base >= -36.") + * + */ + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Base_must_satisfy_2_base_62_or_2); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); + + /* "mpfr.pyx":113 + * c_digits = cgmp.mpz_get_str(NULL, base, &op._value) + * if c_digits == NULL: + * raise RuntimeError("Error during string conversion.") # <<<<<<<<<<<<<< + * c_digits_alloc = strlen(c_digits) + 1 + * + */ + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Error_during_string_conversion); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + + /* "mpfr.pyx":124 + * + * # Return a plain string on Python 2, and a Unicode string on Python 3. + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * return digits + * else: + */ + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + + /* "mpfr.pyx":215 + * return 0 + * else: + * raise ValueError( # <<<<<<<<<<<<<< + * "base should be zero or in the range 2 to 62 (inclusive)" + * ) + */ + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_base_should_be_zero_or_in_the_ra); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 215, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__5); + __Pyx_GIVEREF(__pyx_tuple__5); + + /* "mpfr.pyx":222 + * return 0 + * else: + * raise ValueError("base should be in the range 2 to 62 (inclusive)") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_base_should_be_in_the_range_2_to); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 222, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__6); + __Pyx_GIVEREF(__pyx_tuple__6); + + /* "mpfr.pyx":240 + * if n == 1 and (b & (b-1) != 0): + * return 0 + * raise ValueError("n should be either 0 or at least 2") # <<<<<<<<<<<<<< + * + * + */ + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_n_should_be_either_0_or_at_least); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__7); + __Pyx_GIVEREF(__pyx_tuple__7); + + /* "mpfr.pyx":1102 + * + * """ + * warnings.warn( # <<<<<<<<<<<<<< + * "mpfr_root is deprecated. Use mpfr_rootn_ui instead.", + * category=DeprecationWarning, + */ + __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_mpfr_root_is_deprecated_Use_mpfr); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 1102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__8); + __Pyx_GIVEREF(__pyx_tuple__8); + + /* "mpfr.pyx":2299 + * elt = tab[i] + * if elt is None: + * raise TypeError("Cannot convert None to mpfr.Mpfr_t") # <<<<<<<<<<<<<< + * check_initialized(elt) + * pointers[i] = &elt._value + */ + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Cannot_convert_None_to_mpfr_Mpfr); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 2299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__9); + __Pyx_GIVEREF(__pyx_tuple__9); + + /* "mpfr.pyx":2923 + * error_code = cmpfr.mpfr_set_exp(&op._value, exp) + * if error_code: + * raise ValueError("exponent not in current exponent range") # <<<<<<<<<<<<<< + * + * def mpfr_signbit(Mpfr_t op not None): + */ + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_exponent_not_in_current_exponent); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 2923, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + + /* "mpfr.pyx":3117 + * error_code = cmpfr.mpfr_set_emin(exp) + * if error_code: + * raise ValueError("new exponent for emin is outside allowable range") # <<<<<<<<<<<<<< + * + * def mpfr_set_emax(cmpfr.mpfr_exp_t exp): + */ + __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_new_exponent_for_emin_is_outside); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 3117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__11); + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__13); + __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 1, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__15); + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 3, __pyx_L1_error) + + /* "mpfr.pyx":55 + * + * + * def mpz_set_str(Mpz_t rop not None, object s, int base): # <<<<<<<<<<<<<< + * """ + * Set rop from a string. + */ + __pyx_tuple__17 = PyTuple_Pack(5, __pyx_n_s_rop, __pyx_n_s_s, __pyx_n_s_base, __pyx_n_s_bytes_s, __pyx_n_s_err); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpz_set_str, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 55, __pyx_L1_error) + + /* "mpfr.pyx":86 + * + * + * def mpz_get_str(int base, Mpz_t op not None): # <<<<<<<<<<<<<< + * """ + * Convert to a string of digits in a given base. + */ + __pyx_tuple__19 = PyTuple_Pack(7, __pyx_n_s_base, __pyx_n_s_op, __pyx_n_s_digits, __pyx_n_s_c_digits, __pyx_n_s_freefunc, __pyx_n_s_c_digits_len, __pyx_n_s_c_digits_alloc); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpz_get_str, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 86, __pyx_L1_error) + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 1, __pyx_L1_error) + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + */ + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 3, __pyx_L1_error) + + /* "mpfr.pyx":352 + * ############################################################################### + * + * def mpfr_initialized_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op has been initialized. Return False otherwise. + */ + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_op); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__23); + __Pyx_GIVEREF(__pyx_tuple__23); + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_initialized_p, 352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 352, __pyx_L1_error) + + /* "mpfr.pyx":364 + * ############################################################################### + * + * def mpfr_init2(Mpfr_t x not None, cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Initialize x, set its precision to be prec bits and its value to NaN. + */ + __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_prec); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__25); + __Pyx_GIVEREF(__pyx_tuple__25); + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_init2, 364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 364, __pyx_L1_error) + + /* "mpfr.pyx":379 + * cmpfr.mpfr_init2(&x._value, prec) + * + * def mpfr_inits2(cmpfr.mpfr_prec_t prec, *args): # <<<<<<<<<<<<<< + * """ + * Initialize each of the variables in args: set its precision to prec bits + */ + __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_prec, __pyx_n_s_args, __pyx_n_s_arg); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__27); + __Pyx_GIVEREF(__pyx_tuple__27); + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_inits2, 379, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(1, 379, __pyx_L1_error) + + /* "mpfr.pyx":389 + * mpfr_init2(arg, prec) + * + * def mpfr_clear(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Free the space occupied by the significand of x. + */ + __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__29); + __Pyx_GIVEREF(__pyx_tuple__29); + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_clear, 389, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(1, 389, __pyx_L1_error) + + /* "mpfr.pyx":400 + * cmpfr.mpfr_clear(&x._value) + * + * def mpfr_clears(*args): # <<<<<<<<<<<<<< + * """ + * Free the space occupied by each of the variables in args. See mpfr_clear + */ + __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_arg); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__31); + __Pyx_GIVEREF(__pyx_tuple__31); + __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_clears, 400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(1, 400, __pyx_L1_error) + + /* "mpfr.pyx":409 + * mpfr_clear(arg) + * + * def mpfr_init(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Initialize x, set its precision to the default precision, and set its value + */ + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_init, 409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(1, 409, __pyx_L1_error) + + /* "mpfr.pyx":422 + * cmpfr.mpfr_init(&x._value) + * + * def mpfr_inits(*args): # <<<<<<<<<<<<<< + * """ + * Initialize each of the variables in args: set its precision to the default + */ + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_inits, 422, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 422, __pyx_L1_error) + + /* "mpfr.pyx":435 + * mpfr_init(arg) + * + * def mpfr_set_default_prec(cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Set the default precision to be exactly prec bits. + */ + __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_prec); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_default_prec, 435, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 435, __pyx_L1_error) + + /* "mpfr.pyx":449 + * cmpfr.mpfr_set_default_prec(prec) + * + * def mpfr_get_default_prec(): # <<<<<<<<<<<<<< + * """ + * Return the current default MPFR precision in bits. + */ + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_default_prec, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 449, __pyx_L1_error) + + /* "mpfr.pyx":456 + * return cmpfr.mpfr_get_default_prec() + * + * def mpfr_set_prec(Mpfr_t x not None, cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Reset precision of x. + */ + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_prec, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(1, 456, __pyx_L1_error) + + /* "mpfr.pyx":473 + * cmpfr.mpfr_set_prec(&x._value, prec) + * + * def mpfr_get_prec(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Return the precision of x + */ + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_prec, 473, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 473, __pyx_L1_error) + + /* "mpfr.pyx":488 + * ############################################################################### + * + * def mpfr_set(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop from op, rounded in the direction rnd. + */ + __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_rop, __pyx_n_s_op, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__40); + __Pyx_GIVEREF(__pyx_tuple__40); + __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 488, __pyx_L1_error) + + /* "mpfr.pyx":501 + * return cmpfr.mpfr_set(&rop._value, &op._value, rnd) + * + * def mpfr_set_ui(Mpfr_t rop not None, unsigned long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_ui, 501, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(1, 501, __pyx_L1_error) + + /* "mpfr.pyx":515 + * return cmpfr.mpfr_set_ui(&rop._value, op, rnd) + * + * def mpfr_set_si(Mpfr_t rop not None, long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from an integer, rounded in the direction rnd. + */ + __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_si, 515, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(1, 515, __pyx_L1_error) + + /* "mpfr.pyx":528 + * return cmpfr.mpfr_set_si(&rop._value, op, rnd) + * + * def mpfr_set_d(Mpfr_t rop not None, double op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from a Python float op, rounded in the direction rnd. + */ + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_d, 528, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(1, 528, __pyx_L1_error) + + /* "mpfr.pyx":547 + * return cmpfr.mpfr_set_d(&rop._value, op, rnd) + * + * def mpfr_set_z(Mpfr_t rop not None, Mpz_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from a GMP integer op, rounded in the direction rnd. + */ + __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_z, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(1, 547, __pyx_L1_error) + + /* "mpfr.pyx":559 + * return cmpfr.mpfr_set_z(&rop._value, &op._value, rnd) + * + * def mpfr_set_ui_2exp(Mpfr_t rop not None, unsigned long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_tuple__46 = PyTuple_Pack(4, __pyx_n_s_rop, __pyx_n_s_op, __pyx_n_s_e, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__46); + __Pyx_GIVEREF(__pyx_tuple__46); + __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_ui_2exp, 559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(1, 559, __pyx_L1_error) + + /* "mpfr.pyx":573 + * return cmpfr.mpfr_set_ui_2exp(&rop._value, op, e, rnd) + * + * def mpfr_set_si_2exp(Mpfr_t rop not None, long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_si_2exp, 573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(1, 573, __pyx_L1_error) + + /* "mpfr.pyx":587 + * return cmpfr.mpfr_set_si_2exp(&rop._value, op, e, rnd) + * + * def mpfr_set_z_2exp(Mpfr_t rop not None, Mpz_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_z_2exp, 587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(1, 587, __pyx_L1_error) + + /* "mpfr.pyx":600 + * return cmpfr.mpfr_set_z_2exp(&rop._value, &op._value, e, rnd) + * + * def mpfr_set_str(Mpfr_t rop not None, object s, int base, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop from a string s. + */ + __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_rop, __pyx_n_s_s, __pyx_n_s_base, __pyx_n_s_rnd, __pyx_n_s_bytes_s); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__50); + __Pyx_GIVEREF(__pyx_tuple__50); + __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_str, 600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(1, 600, __pyx_L1_error) + + /* "mpfr.pyx":622 + * return cmpfr.mpfr_set_str(&rop._value, bytes_s, base, rnd) + * + * def mpfr_strtofr(Mpfr_t rop not None, object s, int base, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Read a floating-point number from a string. + */ + __pyx_tuple__52 = PyTuple_Pack(9, __pyx_n_s_rop, __pyx_n_s_s, __pyx_n_s_base, __pyx_n_s_rnd, __pyx_n_s_endptr, __pyx_n_s_startptr, __pyx_n_s_bytes_s, __pyx_n_s_ternary, __pyx_n_s_endindex); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__52); + __Pyx_GIVEREF(__pyx_tuple__52); + __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_strtofr, 622, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(1, 622, __pyx_L1_error) + + /* "mpfr.pyx":702 + * return ternary, endindex + * + * def mpfr_set_nan(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ Set x to a NaN. + * + */ + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_nan, 702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(1, 702, __pyx_L1_error) + + /* "mpfr.pyx":712 + * cmpfr.mpfr_set_nan(&op._value) + * + * def mpfr_set_inf(Mpfr_t op not None, int sign): # <<<<<<<<<<<<<< + * """ Set x to an infinity. + * + */ + __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_op, __pyx_n_s_sign); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_inf, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(1, 712, __pyx_L1_error) + + /* "mpfr.pyx":726 + * cmpfr.mpfr_set_inf(&op._value, sign) + * + * def mpfr_set_zero(Mpfr_t op not None, int sign): # <<<<<<<<<<<<<< + * """ Set x to a zero. + * + */ + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_zero, 726, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(1, 726, __pyx_L1_error) + + /* "mpfr.pyx":740 + * cmpfr.mpfr_set_zero(&op._value, sign) + * + * def mpfr_swap(Mpfr_t x not None, Mpfr_t y not None): # <<<<<<<<<<<<<< + * """ + * Swap the values of x and y efficiently. + */ + __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_swap, 740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(1, 740, __pyx_L1_error) + + /* "mpfr.pyx":758 + * ############################################################################### + * + * def mpfr_get_d(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to a Python float. + */ + __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_op, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_d, 758, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(1, 758, __pyx_L1_error) + + /* "mpfr.pyx":773 + * return cmpfr.mpfr_get_d(&op._value, rnd) + * + * def mpfr_get_si(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to an integer that's within the range of a C long. + */ + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_si, 773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(1, 773, __pyx_L1_error) + + /* "mpfr.pyx":788 + * return cmpfr.mpfr_get_si(&op._value, rnd) + * + * def mpfr_get_ui(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to an integer that's within the range of a C unsigned long. + */ + __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_ui, 788, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(1, 788, __pyx_L1_error) + + /* "mpfr.pyx":803 + * return cmpfr.mpfr_get_ui(&op._value, rnd) + * + * def mpfr_get_d_2exp(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to a Python float and an exponent. + */ + __pyx_tuple__64 = PyTuple_Pack(4, __pyx_n_s_op, __pyx_n_s_rnd, __pyx_n_s_exp, __pyx_n_s_d); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_d_2exp, 803, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(1, 803, __pyx_L1_error) + + /* "mpfr.pyx":824 + * return d, exp + * + * def mpfr_frexp(Mpfr_t y not None, Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """Decompose 'x' in the form 2**e * y. + * + */ + __pyx_tuple__66 = PyTuple_Pack(5, __pyx_n_s_y, __pyx_n_s_x, __pyx_n_s_rnd, __pyx_n_s_exp, __pyx_n_s_ternary); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_frexp, 824, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(1, 824, __pyx_L1_error) + + /* "mpfr.pyx":843 + * return ternary, exp + * + * def mpfr_get_z_2exp(Mpz_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Decompose as a product of an integer and a power of two. + */ + __pyx_tuple__68 = PyTuple_Pack(4, __pyx_n_s_rop, __pyx_n_s_op, __pyx_n_s_exp, __pyx_n_s_exponent); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(1, 843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_z_2exp, 843, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(1, 843, __pyx_L1_error) + + /* "mpfr.pyx":865 + * return exponent + * + * def mpfr_get_z(Mpz_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert to a GMP integer. + */ + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_z, 865, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(1, 865, __pyx_L1_error) + + /* "mpfr.pyx":881 + * return cmpfr.mpfr_get_z(&rop._value, &op._value, rnd) + * + * def mpfr_get_str(int b, size_t n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Compute a base 'b' string representation for 'op'. + */ + __pyx_tuple__71 = PyTuple_Pack(7, __pyx_n_s_b, __pyx_n_s_n, __pyx_n_s_op, __pyx_n_s_rnd, __pyx_n_s_exp, __pyx_n_s_digits, __pyx_n_s_c_digits); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(1, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_str, 881, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(1, 881, __pyx_L1_error) + + /* "mpfr.pyx":943 + * return digits.decode('ascii'), exp + * + * def mpfr_fits_ulong_p(Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return True if op would fit into a C unsigned long int. + */ + __pyx_tuple__73 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(1, 943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_fits_ulong_p, 943, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(1, 943, __pyx_L1_error) + + /* "mpfr.pyx":955 + * return bool(cmpfr.mpfr_fits_ulong_p(&x._value, rnd)) + * + * def mpfr_fits_slong_p(Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return True if op would fit into a C long int. + */ + __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_fits_slong_p, 955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(1, 955, __pyx_L1_error) + + /* "mpfr.pyx":972 + * ############################################################################### + * + * def mpfr_add(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_tuple__76 = PyTuple_Pack(4, __pyx_n_s_rop, __pyx_n_s_op1, __pyx_n_s_op2, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(1, 972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__76); + __Pyx_GIVEREF(__pyx_tuple__76); + __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_add, 972, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(1, 972, __pyx_L1_error) + + /* "mpfr.pyx":984 + * return cmpfr.mpfr_add(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sub(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_sub, 984, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(1, 984, __pyx_L1_error) + + /* "mpfr.pyx":996 + * return cmpfr.mpfr_sub(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_mul(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_mul, 996, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(1, 996, __pyx_L1_error) + + /* "mpfr.pyx":1008 + * return cmpfr.mpfr_mul(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sqr(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the square of op, rounded in the direction rnd. + */ + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_sqr, 1008, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(1, 1008, __pyx_L1_error) + + /* "mpfr.pyx":1018 + * return cmpfr.mpfr_sqr(&rop._value, &op._value, rnd) + * + * def mpfr_div(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_div, 1018, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(1, 1018, __pyx_L1_error) + + /* "mpfr.pyx":1030 + * return cmpfr.mpfr_div(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sqrt(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the square root of op, rounded in the direction rnd. + */ + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_sqrt, 1030, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(1, 1030, __pyx_L1_error) + + /* "mpfr.pyx":1043 + * return cmpfr.mpfr_sqrt(&rop._value, &op._value, rnd) + * + * def mpfr_rec_sqrt(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_rec_sqrt, 1043, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(1, 1043, __pyx_L1_error) + + /* "mpfr.pyx":1056 + * return cmpfr.mpfr_rec_sqrt(&rop._value, &op._value, rnd) + * + * def mpfr_cbrt(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cube root of op rounded in the direction rnd. + */ + __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_cbrt, 1056, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(1, 1056, __pyx_L1_error) + + /* "mpfr.pyx":1069 + * return cmpfr.mpfr_cbrt(&rop._value, &op._value, rnd) + * + * def mpfr_rootn_ui(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_tuple__85 = PyTuple_Pack(4, __pyx_n_s_rop, __pyx_n_s_op, __pyx_n_s_k, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(1, 1069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__85); + __Pyx_GIVEREF(__pyx_tuple__85); + __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_rootn_ui, 1069, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(1, 1069, __pyx_L1_error) + + /* "mpfr.pyx":1088 + * return cmpfr.mpfr_rootn_ui(&rop._value, &op._value, k, rnd) + * + * def mpfr_root(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_root, 1088, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(1, 1088, __pyx_L1_error) + + /* "mpfr.pyx":1112 + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + * + * def _mpfr_root_no_warn(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * + */ + __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_root_no_warn, 1112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(1, 1112, __pyx_L1_error) + + /* "mpfr.pyx":1126 + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + * + * def mpfr_pow(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_pow, 1126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(1, 1126, __pyx_L1_error) + + /* "mpfr.pyx":1175 + * return cmpfr.mpfr_pow(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_neg(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to -op, rounded in the direction rnd. + */ + __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_neg, 1175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(1, 1175, __pyx_L1_error) + + /* "mpfr.pyx":1189 + * return cmpfr.mpfr_neg(&rop._value, &op._value, rnd) + * + * def mpfr_abs(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the absolute value of op, rounded in the direction rnd. + */ + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_abs, 1189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(1, 1189, __pyx_L1_error) + + /* "mpfr.pyx":1203 + * return cmpfr.mpfr_abs(&rop._value, &op._value, rnd) + * + * def mpfr_dim(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_dim, 1203, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(1, 1203, __pyx_L1_error) + + /* "mpfr.pyx":1223 + * ############################################################################### + * + * def mpfr_cmp(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Perform a three-way comparison of op1 and op2. + */ + __pyx_tuple__93 = PyTuple_Pack(2, __pyx_n_s_op1, __pyx_n_s_op2); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(1, 1223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__93); + __Pyx_GIVEREF(__pyx_tuple__93); + __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_cmp, 1223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(1, 1223, __pyx_L1_error) + + /* "mpfr.pyx":1243 + * return cmpfr.mpfr_cmp(&op1._value, &op2._value) + * + * def mpfr_cmpabs(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Compare the absolute values of op1 and op2. + */ + __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_cmpabs, 1243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(1, 1243, __pyx_L1_error) + + /* "mpfr.pyx":1256 + * return cmpfr.mpfr_cmpabs(&op1._value, &op2._value) + * + * def mpfr_nan_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is a NaN. Return False otherwise. + */ + __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_nan_p, 1256, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(1, 1256, __pyx_L1_error) + + /* "mpfr.pyx":1264 + * return bool(cmpfr.mpfr_nan_p(&op._value)) + * + * def mpfr_inf_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an infinity. Return False otherwise. + */ + __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_inf_p, 1264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(1, 1264, __pyx_L1_error) + + /* "mpfr.pyx":1272 + * return bool(cmpfr.mpfr_inf_p(&op._value)) + * + * def mpfr_number_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an ordinary number. Return False otherwise. + */ + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_number_p, 1272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(1, 1272, __pyx_L1_error) + + /* "mpfr.pyx":1282 + * return bool(cmpfr.mpfr_number_p(&op._value)) + * + * def mpfr_zero_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is zero. Return False otherwise. + */ + __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_zero_p, 1282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(1, 1282, __pyx_L1_error) + + /* "mpfr.pyx":1290 + * return bool(cmpfr.mpfr_zero_p(&op._value)) + * + * def mpfr_regular_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is a regular number. Return False otherwise. + */ + __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_regular_p, 1290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(1, 1290, __pyx_L1_error) + + /* "mpfr.pyx":1301 + * return bool(cmpfr.mpfr_regular_p(&op._value)) + * + * def mpfr_sgn(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return the sign of op. + */ + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_sgn, 1301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(1, 1301, __pyx_L1_error) + + /* "mpfr.pyx":1313 + * return cmpfr.mpfr_sgn(&op._value) + * + * def mpfr_greater_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 > op2 and False otherwise. + */ + __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_greater_p, 1313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(1, 1313, __pyx_L1_error) + + /* "mpfr.pyx":1324 + * return bool(cmpfr.mpfr_greater_p(&op1._value, &op2._value)) + * + * def mpfr_greaterequal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 >= op2 and False otherwise. + */ + __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_greaterequal_p, 1324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(1, 1324, __pyx_L1_error) + + /* "mpfr.pyx":1335 + * return bool(cmpfr.mpfr_greaterequal_p(&op1._value, &op2._value)) + * + * def mpfr_less_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 < op2 and False otherwise. + */ + __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_less_p, 1335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(1, 1335, __pyx_L1_error) + + /* "mpfr.pyx":1346 + * return bool(cmpfr.mpfr_less_p(&op1._value, &op2._value)) + * + * def mpfr_lessequal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 <= op2 and False otherwise. + */ + __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_lessequal_p, 1346, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(1, 1346, __pyx_L1_error) + + /* "mpfr.pyx":1357 + * return bool(cmpfr.mpfr_lessequal_p(&op1._value, &op2._value)) + * + * def mpfr_equal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 == op2 and False otherwise. + */ + __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_equal_p, 1357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(1, 1357, __pyx_L1_error) + + /* "mpfr.pyx":1368 + * return bool(cmpfr.mpfr_equal_p(&op1._value, &op2._value)) + * + * def mpfr_lessgreater_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 < op2 or op1 > op2 and False otherwise. + */ + __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_lessgreater_p, 1368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(1, 1368, __pyx_L1_error) + + /* "mpfr.pyx":1379 + * return bool(cmpfr.mpfr_lessgreater_p(&op1._value, &op2._value)) + * + * def mpfr_unordered_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 or op2 is a NaN and False otherwise. + */ + __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_unordered_p, 1379, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(1, 1379, __pyx_L1_error) + + /* "mpfr.pyx":1393 + * ############################################################################### + * + * def mpfr_log(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the natural logarithm of op, rounded in the direction rnd. + */ + __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_log, 1393, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(1, 1393, __pyx_L1_error) + + /* "mpfr.pyx":1403 + * return cmpfr.mpfr_log(&rop._value, &op._value, rnd) + * + * def mpfr_log_ui(Mpfr_t rop not None, unsigned long op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the natural logarithm of op, rounded in the direction rnd. + */ + __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_log_ui, 1403, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(1, 1403, __pyx_L1_error) + + /* "mpfr.pyx":1412 + * return cmpfr.mpfr_log_ui(&rop._value, op, rnd) + * + * def mpfr_log2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the base-two logarithm of op, rounded in the direction rnd. + */ + __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_log2, 1412, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(1, 1412, __pyx_L1_error) + + /* "mpfr.pyx":1422 + * return cmpfr.mpfr_log2(&rop._value, &op._value, rnd) + * + * def mpfr_log10(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the base-ten logarithm of op, rounded in the direction rnd. + */ + __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_log10, 1422, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(1, 1422, __pyx_L1_error) + + /* "mpfr.pyx":1432 + * return cmpfr.mpfr_log10(&rop._value, &op._value, rnd) + * + * def mpfr_log1p(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the logarithm of one plus op, rounded in the direction rnd. + */ + __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_log1p, 1432, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(1, 1432, __pyx_L1_error) + + /* "mpfr.pyx":1442 + * return cmpfr.mpfr_log1p(&rop._value, &op._value, rnd) + * + * def mpfr_exp(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential of op, rounded in the direction rnd. + */ + __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_exp, 1442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(1, 1442, __pyx_L1_error) + + /* "mpfr.pyx":1452 + * return cmpfr.mpfr_exp(&rop._value, &op._value, rnd) + * + * def mpfr_exp2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to two raised to the power op, rounded in the direction rnd. + */ + __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_exp2, 1452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(1, 1452, __pyx_L1_error) + + /* "mpfr.pyx":1462 + * return cmpfr.mpfr_exp2(&rop._value, &op._value, rnd) + * + * def mpfr_exp10(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to ten raised to the power op, rounded in the direction rnd. + */ + __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_exp10, 1462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(1, 1462, __pyx_L1_error) + + /* "mpfr.pyx":1472 + * return cmpfr.mpfr_exp10(&rop._value, &op._value, rnd) + * + * def mpfr_expm1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential of op followed by a subtraction by one, rounded + */ + __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_expm1, 1472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(1, 1472, __pyx_L1_error) + + /* "mpfr.pyx":1483 + * return cmpfr.mpfr_expm1(&rop._value, &op._value, rnd) + * + * def mpfr_cos(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cosine of op, rounded in the direction rnd. + */ + __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_cos, 1483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(1, 1483, __pyx_L1_error) + + /* "mpfr.pyx":1493 + * return cmpfr.mpfr_cos(&rop._value, &op._value, rnd) + * + * def mpfr_sin(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the sine of op, rounded in the direction rnd. + */ + __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_sin, 1493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(1, 1493, __pyx_L1_error) + + /* "mpfr.pyx":1503 + * return cmpfr.mpfr_sin(&rop._value, &op._value, rnd) + * + * def mpfr_tan(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the tangent of op, rounded in the direction rnd. + */ + __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_tan, 1503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(1, 1503, __pyx_L1_error) + + /* "mpfr.pyx":1513 + * return cmpfr.mpfr_tan(&rop._value, &op._value, rnd) + * + * def mpfr_sin_cos(Mpfr_t sop not None, Mpfr_t cop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_tuple__121 = PyTuple_Pack(5, __pyx_n_s_sop, __pyx_n_s_cop, __pyx_n_s_op, __pyx_n_s_rnd, __pyx_n_s_ternary_pair); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(1, 1513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__121); + __Pyx_GIVEREF(__pyx_tuple__121); + __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_sin_cos, 1513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(1, 1513, __pyx_L1_error) + + /* "mpfr.pyx":1538 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_sec(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the secant of op, rounded in the direction rnd. + */ + __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_sec, 1538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(1, 1538, __pyx_L1_error) + + /* "mpfr.pyx":1548 + * return cmpfr.mpfr_sec(&rop._value, &op._value, rnd) + * + * def mpfr_csc(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cosecant of op, rounded in the direction rnd. + */ + __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_csc, 1548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(1, 1548, __pyx_L1_error) + + /* "mpfr.pyx":1558 + * return cmpfr.mpfr_csc(&rop._value, &op._value, rnd) + * + * def mpfr_cot(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cotangent of op, rounded in the direction rnd. + */ + __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_cot, 1558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(1, 1558, __pyx_L1_error) + + /* "mpfr.pyx":1568 + * return cmpfr.mpfr_cot(&rop._value, &op._value, rnd) + * + * def mpfr_acos(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-cosine of op, rounded in the direction rnd. + */ + __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_acos, 1568, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(1, 1568, __pyx_L1_error) + + /* "mpfr.pyx":1584 + * return cmpfr.mpfr_acos(&rop._value, &op._value, rnd) + * + * def mpfr_asin(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-sine of op, rounded in the direction rnd. + */ + __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_asin, 1584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(1, 1584, __pyx_L1_error) + + /* "mpfr.pyx":1600 + * return cmpfr.mpfr_asin(&rop._value, &op._value, rnd) + * + * def mpfr_atan(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-tangent of op, rounded in the direction rnd. + */ + __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_atan, 1600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(1, 1600, __pyx_L1_error) + + /* "mpfr.pyx":1616 + * return cmpfr.mpfr_atan(&rop._value, &op._value, rnd) + * + * def mpfr_atan2(Mpfr_t rop not None, Mpfr_t y not None, # <<<<<<<<<<<<<< + * Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_tuple__129 = PyTuple_Pack(4, __pyx_n_s_rop, __pyx_n_s_y, __pyx_n_s_x, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(1, 1616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__129); + __Pyx_GIVEREF(__pyx_tuple__129); + __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_atan2, 1616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(1, 1616, __pyx_L1_error) + + /* "mpfr.pyx":1659 + * return cmpfr.mpfr_atan2(&rop._value, &y._value, &x._value, rnd) + * + * def mpfr_cosh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cosine of op, rounded in the direction rnd. + */ + __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_cosh, 1659, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(1, 1659, __pyx_L1_error) + + /* "mpfr.pyx":1669 + * return cmpfr.mpfr_cosh(&rop._value, &op._value, rnd) + * + * def mpfr_sinh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic sine of op, rounded in the direction rnd. + */ + __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_sinh, 1669, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(1, 1669, __pyx_L1_error) + + /* "mpfr.pyx":1679 + * return cmpfr.mpfr_sinh(&rop._value, &op._value, rnd) + * + * def mpfr_tanh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic tangent of op, rounded in the direction rnd. + */ + __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_tanh, 1679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(1, 1679, __pyx_L1_error) + + /* "mpfr.pyx":1689 + * return cmpfr.mpfr_tanh(&rop._value, &op._value, rnd) + * + * def mpfr_sinh_cosh(Mpfr_t sop not None, Mpfr_t cop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_sinh_cosh, 1689, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(1, 1689, __pyx_L1_error) + + /* "mpfr.pyx":1714 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_sech(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic secant of op, rounded in the direction rnd. + */ + __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_sech, 1714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(1, 1714, __pyx_L1_error) + + /* "mpfr.pyx":1724 + * return cmpfr.mpfr_sech(&rop._value, &op._value, rnd) + * + * def mpfr_csch(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cosecant of op, rounded in the direction rnd. + */ + __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_csch, 1724, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(1, 1724, __pyx_L1_error) + + /* "mpfr.pyx":1734 + * return cmpfr.mpfr_csch(&rop._value, &op._value, rnd) + * + * def mpfr_coth(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cotangent of op, rounded in the direction rnd. + */ + __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_coth, 1734, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(1, 1734, __pyx_L1_error) + + /* "mpfr.pyx":1744 + * return cmpfr.mpfr_coth(&rop._value, &op._value, rnd) + * + * def mpfr_acosh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic cosine of op, rounded in the direction rnd. + */ + __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_acosh, 1744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(1, 1744, __pyx_L1_error) + + /* "mpfr.pyx":1754 + * return cmpfr.mpfr_acosh(&rop._value, &op._value, rnd) + * + * def mpfr_asinh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic sine of op, rounded in the direction rnd. + */ + __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_asinh, 1754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(1, 1754, __pyx_L1_error) + + /* "mpfr.pyx":1764 + * return cmpfr.mpfr_asinh(&rop._value, &op._value, rnd) + * + * def mpfr_atanh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic tangent of op, rounded in the direction rnd. + */ + __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_atanh, 1764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(1, 1764, __pyx_L1_error) + + /* "mpfr.pyx":1774 + * return cmpfr.mpfr_atanh(&rop._value, &op._value, rnd) + * + * def mpfr_fac_ui(Mpfr_t rop not None, unsigned long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the factorial of op, rounded in the direction rnd. + */ + __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_fac_ui, 1774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(1, 1774, __pyx_L1_error) + + /* "mpfr.pyx":1783 + * return cmpfr.mpfr_fac_ui(&rop._value, op, rnd) + * + * def mpfr_eint(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential integral of op, rounded in the direction + */ + __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_eint, 1783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(1, 1783, __pyx_L1_error) + + /* "mpfr.pyx":1799 + * return cmpfr.mpfr_eint(&rop._value, &op._value, rnd) + * + * def mpfr_li2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to real part of the dilogarithm of op, rounded in the direction + */ + __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_li2, 1799, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(1, 1799, __pyx_L1_error) + + /* "mpfr.pyx":1813 + * return cmpfr.mpfr_li2(&rop._value, &op._value, rnd) + * + * def mpfr_gamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Gamma function on op, rounded in the direction + */ + __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_gamma, 1813, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(1, 1813, __pyx_L1_error) + + /* "mpfr.pyx":1826 + * return cmpfr.mpfr_gamma(&rop._value, &op._value, rnd) + * + * def mpfr_gamma_inc(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_tuple__145 = PyTuple_Pack(4, __pyx_n_s_rop, __pyx_n_s_op, __pyx_n_s_op2, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(1, 1826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__145); + __Pyx_GIVEREF(__pyx_tuple__145); + __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_gamma_inc, 1826, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(1, 1826, __pyx_L1_error) + + /* "mpfr.pyx":1842 + * return cmpfr.mpfr_gamma_inc(&rop._value, &op._value, &op2._value, rnd) + * + * def mpfr_lngamma(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_lngamma, 1842, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(1, 1842, __pyx_L1_error) + + /* "mpfr.pyx":1857 + * return cmpfr.mpfr_lngamma(&rop._value, &op._value, rnd) + * + * def mpfr_lgamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the logarithm of the absolute value of the Gamma + */ + __pyx_tuple__148 = PyTuple_Pack(5, __pyx_n_s_rop, __pyx_n_s_op, __pyx_n_s_rnd, __pyx_n_s_signp, __pyx_n_s_ternary); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(1, 1857, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__148); + __Pyx_GIVEREF(__pyx_tuple__148); + __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_lgamma, 1857, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(1, 1857, __pyx_L1_error) + + /* "mpfr.pyx":1880 + * return ternary, signp + * + * def mpfr_digamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Digamma (sometimes also called Psi) function on + */ + __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_digamma, 1880, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(1, 1880, __pyx_L1_error) + + /* "mpfr.pyx":1893 + * return cmpfr.mpfr_digamma(&rop._value, &op._value, rnd) + * + * def mpfr_beta(Mpfr_t rop not None, Mpfr_t op1 not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_beta, 1893, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(1, 1893, __pyx_L1_error) + + /* "mpfr.pyx":1905 + * return cmpfr.mpfr_beta(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_zeta(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Riemann Zeta function on op, rounded in the + */ + __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_zeta, 1905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(1, 1905, __pyx_L1_error) + + /* "mpfr.pyx":1916 + * return cmpfr.mpfr_zeta(&rop._value, &op._value, rnd) + * + * def mpfr_zeta_ui(Mpfr_t rop not None, unsigned long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Riemann Zeta function on op, rounded in the + */ + __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_zeta_ui, 1916, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(1, 1916, __pyx_L1_error) + + /* "mpfr.pyx":1926 + * return cmpfr.mpfr_zeta_ui(&rop._value, op, rnd) + * + * def mpfr_erf(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the error function on op, rounded in the direction + */ + __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_erf, 1926, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(1, 1926, __pyx_L1_error) + + /* "mpfr.pyx":1937 + * return cmpfr.mpfr_erf(&rop._value, &op._value, rnd) + * + * def mpfr_erfc(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the the complementary error function on op, rounded + */ + __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_erfc, 1937, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(1, 1937, __pyx_L1_error) + + /* "mpfr.pyx":1948 + * return cmpfr.mpfr_erfc(&rop._value, &op._value, rnd) + * + * def mpfr_j0(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order 0 on op, + */ + __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_j0, 1948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(1, 1948, __pyx_L1_error) + + /* "mpfr.pyx":1960 + * return cmpfr.mpfr_j0(&rop._value, &op._value, rnd) + * + * def mpfr_j1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order 1, on op, + */ + __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_j1, 1960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(1, 1960, __pyx_L1_error) + + /* "mpfr.pyx":1973 + * return cmpfr.mpfr_j1(&rop._value, &op._value, rnd) + * + * def mpfr_jn(Mpfr_t rop not None, long int n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order n on op, + */ + __pyx_tuple__158 = PyTuple_Pack(4, __pyx_n_s_rop, __pyx_n_s_n, __pyx_n_s_op, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(1, 1973, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__158); + __Pyx_GIVEREF(__pyx_tuple__158); + __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_jn, 1973, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(1, 1973, __pyx_L1_error) + + /* "mpfr.pyx":1987 + * return cmpfr.mpfr_jn(&rop._value, n, &op._value, rnd) + * + * def mpfr_y0(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order 0 on op, + */ + __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_y0, 1987, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(1, 1987, __pyx_L1_error) + + /* "mpfr.pyx":2002 + * return cmpfr.mpfr_y0(&rop._value, &op._value, rnd) + * + * def mpfr_y1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order 1 on op, + */ + __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_y1, 2002, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(1, 2002, __pyx_L1_error) + + /* "mpfr.pyx":2017 + * return cmpfr.mpfr_y1(&rop._value, &op._value, rnd) + * + * def mpfr_yn(Mpfr_t rop not None, long int n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order n on op, + */ + __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_yn, 2017, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(1, 2017, __pyx_L1_error) + + /* "mpfr.pyx":2030 + * return cmpfr.mpfr_yn(&rop._value, n, &op._value, rnd) + * + * def mpfr_fma(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + __pyx_tuple__163 = PyTuple_Pack(5, __pyx_n_s_rop, __pyx_n_s_op1, __pyx_n_s_op2, __pyx_n_s_op3, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(1, 2030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__163); + __Pyx_GIVEREF(__pyx_tuple__163); + __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_fma, 2030, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(1, 2030, __pyx_L1_error) + + /* "mpfr.pyx":2048 + * ) + * + * def mpfr_fms(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_fms, 2048, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(1, 2048, __pyx_L1_error) + + /* "mpfr.pyx":2066 + * ) + * + * def mpfr_fmma(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + __pyx_tuple__166 = PyTuple_Pack(6, __pyx_n_s_rop, __pyx_n_s_op1, __pyx_n_s_op2, __pyx_n_s_op3, __pyx_n_s_op4, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(1, 2066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__166); + __Pyx_GIVEREF(__pyx_tuple__166); + __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_fmma, 2066, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(1, 2066, __pyx_L1_error) + + /* "mpfr.pyx":2086 + * ) + * + * def mpfr_fmms(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_fmms, 2086, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(1, 2086, __pyx_L1_error) + + /* "mpfr.pyx":2106 + * ) + * + * def mpfr_agm(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_agm, 2106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(1, 2106, __pyx_L1_error) + + /* "mpfr.pyx":2124 + * return cmpfr.mpfr_agm(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_hypot(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t x not None, + * Mpfr_t y not None, + */ + __pyx_tuple__170 = PyTuple_Pack(4, __pyx_n_s_rop, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(1, 2124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__170); + __Pyx_GIVEREF(__pyx_tuple__170); + __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_hypot, 2124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(1, 2124, __pyx_L1_error) + + /* "mpfr.pyx":2142 + * return cmpfr.mpfr_hypot(&rop._value, &x._value, &y._value, rnd) + * + * def mpfr_ai(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Airy function Ai on x, rounded in the direction + */ + __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_ai, 2142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(1, 2142, __pyx_L1_error) + + /* "mpfr.pyx":2159 + * return cmpfr.mpfr_ai(&rop._value, &op._value, rnd) + * + * def mpfr_const_log2(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to log(2), rounded in the direction rnd. + */ + __pyx_tuple__173 = PyTuple_Pack(2, __pyx_n_s_rop, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(1, 2159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__173); + __Pyx_GIVEREF(__pyx_tuple__173); + __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_const_log2, 2159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(1, 2159, __pyx_L1_error) + + /* "mpfr.pyx":2172 + * return cmpfr.mpfr_const_log2(&rop._value, rnd) + * + * def mpfr_const_pi(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Pi, rounded in the direction rnd. + */ + __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_const_pi, 2172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(1, 2172, __pyx_L1_error) + + /* "mpfr.pyx":2185 + * return cmpfr.mpfr_const_pi(&rop._value, rnd) + * + * def mpfr_const_euler(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Euler's constant, rounded in the direction rnd. + */ + __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_const_euler, 2185, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(1, 2185, __pyx_L1_error) + + /* "mpfr.pyx":2199 + * return cmpfr.mpfr_const_euler(&rop._value, rnd) + * + * def mpfr_const_catalan(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Catalan's constant, rounded in the direction rnd. + */ + __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_const_catalan, 2199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(1, 2199, __pyx_L1_error) + + /* "mpfr.pyx":2213 + * return cmpfr.mpfr_const_catalan(&rop._value, rnd) + * + * def mpfr_free_cache(): # <<<<<<<<<<<<<< + * """ + * Free internal MPFR caches. + */ + __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_free_cache, 2213, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(1, 2213, __pyx_L1_error) + + /* "mpfr.pyx":2226 + * cmpfr.mpfr_free_cache() + * + * def mpfr_free_cache2(cmpfr.mpfr_free_cache_t way): # <<<<<<<<<<<<<< + * """ + * Free various caches and pools used by MPFR internally, as specified by + */ + __pyx_tuple__179 = PyTuple_Pack(1, __pyx_n_s_way); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(1, 2226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__179); + __Pyx_GIVEREF(__pyx_tuple__179); + __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_free_cache2, 2226, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(1, 2226, __pyx_L1_error) + + /* "mpfr.pyx":2241 + * cmpfr.mpfr_free_cache2(way) + * + * def mpfr_free_pool(): # <<<<<<<<<<<<<< + * + * """ + */ + __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_free_pool, 2241, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(1, 2241, __pyx_L1_error) + + /* "mpfr.pyx":2250 + * cmpfr.mpfr_free_pool() + * + * def mpfr_mp_memory_cleanup(): # <<<<<<<<<<<<<< + * """ + * This function should be called before calling mp_set_memory_functions. See + */ + __pyx_tuple__182 = PyTuple_Pack(1, __pyx_n_s_rc); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(1, 2250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__182); + __Pyx_GIVEREF(__pyx_tuple__182); + __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_mp_memory_cleanup, 2250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(1, 2250, __pyx_L1_error) + + /* "mpfr.pyx":2263 + * "mpfr_mp_memory_cleanup returned nonzero value {}".format(rc)) + * + * def mpfr_sum(Mpfr_t rop not None, tab, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the sum of the elements of tab, rounded in the direction rnd. + */ + __pyx_tuple__184 = PyTuple_Pack(7, __pyx_n_s_rop, __pyx_n_s_tab, __pyx_n_s_rnd, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_elt, __pyx_n_s_pointers); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(1, 2263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__184); + __Pyx_GIVEREF(__pyx_tuple__184); + __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_sum, 2263, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(1, 2263, __pyx_L1_error) + + /* "mpfr.pyx":2310 + * ########################################################################### + * + * def mpfr_asprintf(object template, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Compute a string representation of 'op' based on the given template. + */ + __pyx_tuple__186 = PyTuple_Pack(6, __pyx_n_s_template, __pyx_n_s_op, __pyx_n_s_output, __pyx_n_s_template_bytes, __pyx_n_s_rv, __pyx_n_s_output_as_bytes); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(1, 2310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__186); + __Pyx_GIVEREF(__pyx_tuple__186); + __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_asprintf, 2310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(1, 2310, __pyx_L1_error) + + /* "mpfr.pyx":2343 + * ############################################################################### + * + * def mpfr_rint(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to an integer in the direction given by rnd. + */ + __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_rint, 2343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(1, 2343, __pyx_L1_error) + + /* "mpfr.pyx":2366 + * return cmpfr.mpfr_rint(&rop._value, &op._value, rnd) + * + * def mpfr_ceil(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next higher or equal representable integer. + */ + __pyx_tuple__189 = PyTuple_Pack(2, __pyx_n_s_rop, __pyx_n_s_op); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(1, 2366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__189); + __Pyx_GIVEREF(__pyx_tuple__189); + __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_ceil, 2366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(1, 2366, __pyx_L1_error) + + /* "mpfr.pyx":2381 + * return cmpfr.mpfr_ceil(&rop._value, &op._value) + * + * def mpfr_floor(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next lower or equal representable integer. + */ + __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_floor, 2381, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(1, 2381, __pyx_L1_error) + + /* "mpfr.pyx":2396 + * return cmpfr.mpfr_floor(&rop._value, &op._value) + * + * def mpfr_round(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the nearest representable integer, rounding + */ + __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_round, 2396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(1, 2396, __pyx_L1_error) + + /* "mpfr.pyx":2421 + * return cmpfr.mpfr_round(&rop._value, &op._value) + * + * def mpfr_roundeven(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the nearest representable integer, rounding + */ + __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_roundeven, 2421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(1, 2421, __pyx_L1_error) + + /* "mpfr.pyx":2437 + * return cmpfr.mpfr_roundeven(&rop._value, &op._value) + * + * def mpfr_trunc(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next representable integer toward zero. + */ + __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_trunc, 2437, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(1, 2437, __pyx_L1_error) + + /* "mpfr.pyx":2452 + * return cmpfr.mpfr_trunc(&rop._value, &op._value) + * + * def mpfr_rint_ceil(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_rint_ceil, 2452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(1, 2452, __pyx_L1_error) + + /* "mpfr.pyx":2472 + * return cmpfr.mpfr_rint_ceil(&rop._value, &op._value, rnd) + * + * def mpfr_rint_floor(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_rint_floor, 2472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(1, 2472, __pyx_L1_error) + + /* "mpfr.pyx":2492 + * return cmpfr.mpfr_rint_floor(&rop._value, &op._value, rnd) + * + * def mpfr_rint_round(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_rint_round, 2492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(1, 2492, __pyx_L1_error) + + /* "mpfr.pyx":2518 + * return cmpfr.mpfr_rint_round(&rop._value, &op._value, rnd) + * + * def mpfr_rint_roundeven(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_rint_roundeven, 2518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(1, 2518, __pyx_L1_error) + + /* "mpfr.pyx":2539 + * return cmpfr.mpfr_rint_roundeven(&rop._value, &op._value, rnd) + * + * def mpfr_rint_trunc(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_rint_trunc, 2539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(1, 2539, __pyx_L1_error) + + /* "mpfr.pyx":2559 + * return cmpfr.mpfr_rint_trunc(&rop._value, &op._value, rnd) + * + * def mpfr_frac(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the fractional part of op, having the same sign as op, rounded + */ + __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_frac, 2559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(1, 2559, __pyx_L1_error) + + /* "mpfr.pyx":2571 + * return cmpfr.mpfr_frac(&rop._value, &op._value, rnd) + * + * def mpfr_modf(Mpfr_t iop not None, Mpfr_t fop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_tuple__201 = PyTuple_Pack(5, __pyx_n_s_iop, __pyx_n_s_fop, __pyx_n_s_op, __pyx_n_s_rnd, __pyx_n_s_ternary_pair); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(1, 2571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__201); + __Pyx_GIVEREF(__pyx_tuple__201); + __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_modf, 2571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(1, 2571, __pyx_L1_error) + + /* "mpfr.pyx":2597 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_fmod(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_tuple__203 = PyTuple_Pack(4, __pyx_n_s_r, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(1, 2597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__203); + __Pyx_GIVEREF(__pyx_tuple__203); + __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_fmod, 2597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(1, 2597, __pyx_L1_error) + + /* "mpfr.pyx":2619 + * return cmpfr.mpfr_fmod(&r._value, &x._value, &y._value, rnd) + * + * def mpfr_fmodquo(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_tuple__205 = PyTuple_Pack(6, __pyx_n_s_r, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rnd, __pyx_n_s_quotient, __pyx_n_s_ternary); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(1, 2619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__205); + __Pyx_GIVEREF(__pyx_tuple__205); + __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_fmodquo, 2619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(1, 2619, __pyx_L1_error) + + /* "mpfr.pyx":2651 + * return ternary, quotient + * + * def mpfr_remainder(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_remainder, 2651, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(1, 2651, __pyx_L1_error) + + /* "mpfr.pyx":2673 + * return cmpfr.mpfr_remainder(&r._value, &x._value, &y._value, rnd) + * + * def mpfr_remquo(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_remquo, 2673, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(1, 2673, __pyx_L1_error) + + /* "mpfr.pyx":2706 + * return ternary, quotient + * + * def mpfr_integer_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an integer. Return False otherwise. + */ + __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_integer_p, 2706, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(1, 2706, __pyx_L1_error) + + /* "mpfr.pyx":2719 + * ############################################################################### + * + * def mpfr_set_default_rounding_mode(cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the default rounding mode to rnd. + */ + __pyx_tuple__210 = PyTuple_Pack(1, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(1, 2719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__210); + __Pyx_GIVEREF(__pyx_tuple__210); + __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_default_rounding_mode, 2719, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(1, 2719, __pyx_L1_error) + + /* "mpfr.pyx":2729 + * cmpfr.mpfr_set_default_rounding_mode(rnd) + * + * def mpfr_get_default_rounding_mode(): # <<<<<<<<<<<<<< + * """ + * Get the default rounding mode. + */ + __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_default_rounding_mode, 2729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(1, 2729, __pyx_L1_error) + + /* "mpfr.pyx":2736 + * return cmpfr.mpfr_get_default_rounding_mode() + * + * def mpfr_prec_round( # <<<<<<<<<<<<<< + * Mpfr_t x not None, cmpfr.mpfr_prec_t prec, cmpfr.mpfr_rnd_t rnd + * ): + */ + __pyx_tuple__213 = PyTuple_Pack(3, __pyx_n_s_x, __pyx_n_s_prec, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(1, 2736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__213); + __Pyx_GIVEREF(__pyx_tuple__213); + __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_prec_round, 2736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(1, 2736, __pyx_L1_error) + + /* "mpfr.pyx":2768 + * return cmpfr.mpfr_prec_round(&x._value, prec, rnd) + * + * def mpfr_can_round(Mpfr_t b not None, cmpfr.mpfr_exp_t err, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd1, cmpfr.mpfr_rnd_t rnd2, + * cmpfr.mpfr_prec_t prec): + */ + __pyx_tuple__215 = PyTuple_Pack(5, __pyx_n_s_b, __pyx_n_s_err, __pyx_n_s_rnd1, __pyx_n_s_rnd2, __pyx_n_s_prec); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(1, 2768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__215); + __Pyx_GIVEREF(__pyx_tuple__215); + __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_can_round, 2768, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(1, 2768, __pyx_L1_error) + + /* "mpfr.pyx":2802 + * return bool(cmpfr.mpfr_can_round(&b._value, err, rnd1, rnd2, prec)) + * + * def mpfr_min_prec(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Return the minimal number of bits required to store the significand of x, + */ + __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_min_prec, 2802, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(1, 2802, __pyx_L1_error) + + /* "mpfr.pyx":2814 + * return cmpfr.mpfr_min_prec(&x._value) + * + * def mpfr_print_rnd_mode(cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return a string ("MPFR_RNDD", "MPFR_RNDU", "MPFR_RNDN", "MPFR_RNDZ", + */ + __pyx_tuple__218 = PyTuple_Pack(2, __pyx_n_s_rnd, __pyx_n_s_rounding_mode); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(1, 2814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__218); + __Pyx_GIVEREF(__pyx_tuple__218); + __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_print_rnd_mode, 2814, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(1, 2814, __pyx_L1_error) + + /* "mpfr.pyx":2834 + * ############################################################################### + * + * def mpfr_nexttoward(Mpfr_t x not None, Mpfr_t y not None): # <<<<<<<<<<<<<< + * """ + * Replace x by the next floating-point number in the direction of y. + */ + __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_nexttoward, 2834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(1, 2834, __pyx_L1_error) + + /* "mpfr.pyx":2850 + * cmpfr.mpfr_nexttoward(&x._value, &y._value) + * + * def mpfr_nextabove(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Equivalent to mpfr_nexttoward(op, y) where y is plus infinity. + */ + __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_nextabove, 2850, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(1, 2850, __pyx_L1_error) + + /* "mpfr.pyx":2858 + * cmpfr.mpfr_nextabove(&op._value) + * + * def mpfr_nextbelow(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Equivalent to mpfr_nexttoward(op, y) where y is minus infinity. + */ + __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_nextbelow, 2858, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(1, 2858, __pyx_L1_error) + + /* "mpfr.pyx":2866 + * cmpfr.mpfr_nextbelow(&op._value) + * + * def mpfr_min(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_min, 2866, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(1, 2866, __pyx_L1_error) + + /* "mpfr.pyx":2882 + * return cmpfr.mpfr_min(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_max(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_max, 2882, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(1, 2882, __pyx_L1_error) + + /* "mpfr.pyx":2898 + * return cmpfr.mpfr_max(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_get_exp(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return the exponent of op. + */ + __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_exp, 2898, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(1, 2898, __pyx_L1_error) + + /* "mpfr.pyx":2910 + * return cmpfr.mpfr_get_exp(&op._value) + * + * def mpfr_set_exp(Mpfr_t op not None, cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the exponent of op. + */ + __pyx_tuple__226 = PyTuple_Pack(3, __pyx_n_s_op, __pyx_n_s_exp, __pyx_n_s_error_code); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(1, 2910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__226); + __Pyx_GIVEREF(__pyx_tuple__226); + __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_exp, 2910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(1, 2910, __pyx_L1_error) + + /* "mpfr.pyx":2925 + * raise ValueError("exponent not in current exponent range") + * + * def mpfr_signbit(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op has its sign bit set. Return False otherwise. + */ + __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_signbit, 2925, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(1, 2925, __pyx_L1_error) + + /* "mpfr.pyx":2936 + * return bool(cmpfr.mpfr_signbit(&op._value)) + * + * def mpfr_setsign(Mpfr_t rop not None, Mpfr_t op not None, s, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from op and the sign of rop from s. + */ + __pyx_tuple__229 = PyTuple_Pack(4, __pyx_n_s_rop, __pyx_n_s_op, __pyx_n_s_s, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(1, 2936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__229); + __Pyx_GIVEREF(__pyx_tuple__229); + __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_setsign, 2936, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(1, 2936, __pyx_L1_error) + + /* "mpfr.pyx":2950 + * return cmpfr.mpfr_setsign(&rop._value, &op._value, s, rnd) + * + * def mpfr_copysign(Mpfr_t rop not None, Mpfr_t op1 not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_copysign, 2950, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(1, 2950, __pyx_L1_error) + + /* "mpfr.pyx":2966 + * return cmpfr.mpfr_copysign(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_get_version(): # <<<<<<<<<<<<<< + * """ + * Return the MPFR version, as a string. + */ + __pyx_tuple__232 = PyTuple_Pack(1, __pyx_n_s_version); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(1, 2966, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__232); + __Pyx_GIVEREF(__pyx_tuple__232); + __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_version, 2966, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(1, 2966, __pyx_L1_error) + + /* "mpfr.pyx":2987 + * MPFR_VERSION_STRING = cmpfr.MPFR_VERSION_STRING.decode('ascii') + * + * def MPFR_VERSION_NUM(int major, int minor, int patchlevel): # <<<<<<<<<<<<<< + * """ + * Create an integer in the same format as used by MPFR_VERSION from the given + */ + __pyx_tuple__234 = PyTuple_Pack(3, __pyx_n_s_major, __pyx_n_s_minor, __pyx_n_s_patchlevel); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(1, 2987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__234); + __Pyx_GIVEREF(__pyx_tuple__234); + __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_MPFR_VERSION_NUM, 2987, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(1, 2987, __pyx_L1_error) + + /* "mpfr.pyx":2995 + * return cmpfr.MPFR_VERSION_NUM(major, minor, patchlevel) + * + * def mpfr_get_patches(): # <<<<<<<<<<<<<< + * """ + * Return information about patches applied to the MPFR library. + */ + __pyx_tuple__236 = PyTuple_Pack(1, __pyx_n_s_patches); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(1, 2995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__236); + __Pyx_GIVEREF(__pyx_tuple__236); + __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_patches, 2995, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(1, 2995, __pyx_L1_error) + + /* "mpfr.pyx":3014 + * return patches.decode('ascii').split() + * + * def mpfr_buildopt_tls_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled as thread safe using compiler-level Thread + */ + __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_buildopt_tls_p, 3014, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(1, 3014, __pyx_L1_error) + + /* "mpfr.pyx":3023 + * return bool(cmpfr.mpfr_buildopt_tls_p()) + * + * def mpfr_buildopt_float128_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with '__float128' support (that is, MPFR + */ + __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_buildopt_float128_p, 3023, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(1, 3023, __pyx_L1_error) + + /* "mpfr.pyx":3032 + * return bool(cmpfr.mpfr_buildopt_float128_p()) + * + * def mpfr_buildopt_decimal_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with decimal float support (that is, MPFR + */ + __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_buildopt_decimal_p, 3032, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(1, 3032, __pyx_L1_error) + + /* "mpfr.pyx":3041 + * return bool(cmpfr.mpfr_buildopt_decimal_p()) + * + * def mpfr_buildopt_gmpinternals_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with GMP internals (that is, MPFR was + */ + __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_buildopt_gmpinternals_p, 3041, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(1, 3041, __pyx_L1_error) + + /* "mpfr.pyx":3050 + * return bool(cmpfr.mpfr_buildopt_gmpinternals_p()) + * + * def mpfr_buildopt_sharedcache_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled so that all threads share the same cache + */ + __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_buildopt_sharedcache_p, 3050, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(1, 3050, __pyx_L1_error) + + /* "mpfr.pyx":3061 + * return bool(cmpfr.mpfr_buildopt_sharedcache_p()) + * + * def mpfr_buildopt_tune_case(): # <<<<<<<<<<<<<< + * """ + * Return a string saying which thresholds file has been used at compile + */ + __pyx_tuple__243 = PyTuple_Pack(1, __pyx_n_s_thresholds); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(1, 3061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__243); + __Pyx_GIVEREF(__pyx_tuple__243); + __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_buildopt_tune_case, 3061, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(1, 3061, __pyx_L1_error) + + /* "mpfr.pyx":3079 + * + * + * def mpfr_get_emin(): # <<<<<<<<<<<<<< + * """ + * Return smallest exponent allowed. + */ + __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_emin, 3079, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) __PYX_ERR(1, 3079, __pyx_L1_error) + + /* "mpfr.pyx":3090 + * return cmpfr.mpfr_get_emin() + * + * def mpfr_get_emax(): # <<<<<<<<<<<<<< + * """ + * Return largest exponent allowed. + */ + __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_emax, 3090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) __PYX_ERR(1, 3090, __pyx_L1_error) + + /* "mpfr.pyx":3102 + * return cmpfr.mpfr_get_emax() + * + * def mpfr_set_emin(cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the smallest exponent allowed for a floating-point variable. + */ + __pyx_tuple__247 = PyTuple_Pack(2, __pyx_n_s_exp, __pyx_n_s_error_code); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(1, 3102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__247); + __Pyx_GIVEREF(__pyx_tuple__247); + __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_emin, 3102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(1, 3102, __pyx_L1_error) + + /* "mpfr.pyx":3119 + * raise ValueError("new exponent for emin is outside allowable range") + * + * def mpfr_set_emax(cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the largest exponent allowed for a floating-point variable. + */ + __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_emax, 3119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) __PYX_ERR(1, 3119, __pyx_L1_error) + + /* "mpfr.pyx":3136 + * raise ValueError("new exponent for emin is outside allowable range") + * + * def mpfr_get_emin_min(): # <<<<<<<<<<<<<< + * """ + * Return the minimum exponent allowed for mpfr_set_emin. + */ + __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_emin_min, 3136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(1, 3136, __pyx_L1_error) + + /* "mpfr.pyx":3146 + * return cmpfr.mpfr_get_emin_min() + * + * def mpfr_get_emin_max(): # <<<<<<<<<<<<<< + * """ + * Return the maximum exponent allowed for mpfr_set_emin. + */ + __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_emin_max, 3146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(1, 3146, __pyx_L1_error) + + /* "mpfr.pyx":3156 + * return cmpfr.mpfr_get_emin_max() + * + * def mpfr_get_emax_min(): # <<<<<<<<<<<<<< + * """ + * Return the minimum exponent allowed for mpfr_set_emax. + */ + __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_emax_min, 3156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(1, 3156, __pyx_L1_error) + + /* "mpfr.pyx":3166 + * return cmpfr.mpfr_get_emax_min() + * + * def mpfr_get_emax_max(): # <<<<<<<<<<<<<< + * """ + * Return the maximum exponent allowed for mpfr_set_emax. + */ + __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_get_emax_max, 3166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(1, 3166, __pyx_L1_error) + + /* "mpfr.pyx":3176 + * return cmpfr.mpfr_get_emax_max() + * + * def mpfr_check_range(Mpfr_t x not None, int t, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Modify x if necessary to fit into the current exponent range. + */ + __pyx_tuple__254 = PyTuple_Pack(3, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_rnd); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(1, 3176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__254); + __Pyx_GIVEREF(__pyx_tuple__254); + __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__254, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_check_range, 3176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(1, 3176, __pyx_L1_error) + + /* "mpfr.pyx":3205 + * return cmpfr.mpfr_check_range(&x._value, t, rnd) + * + * def mpfr_subnormalize(Mpfr_t x not None, int t, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Modify x if necessary to account for subnormalization. + */ + __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__254, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_subnormalize, 3205, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) __PYX_ERR(1, 3205, __pyx_L1_error) + + /* "mpfr.pyx":3236 + * return cmpfr.mpfr_subnormalize(&x._value, t, rnd) + * + * def mpfr_clear_underflow(): # <<<<<<<<<<<<<< + * """ + * Clear the underflow flag. + */ + __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_clear_underflow, 3236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(1, 3236, __pyx_L1_error) + + /* "mpfr.pyx":3243 + * cmpfr.mpfr_clear_underflow() + * + * def mpfr_clear_overflow(): # <<<<<<<<<<<<<< + * """ + * Clear the overflow flag. + */ + __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_clear_overflow, 3243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(1, 3243, __pyx_L1_error) + + /* "mpfr.pyx":3250 + * cmpfr.mpfr_clear_overflow() + * + * def mpfr_clear_divby0(): # <<<<<<<<<<<<<< + * """ + * Clear the divide-by-zero flag. + */ + __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_clear_divby0, 3250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(1, 3250, __pyx_L1_error) + + /* "mpfr.pyx":3257 + * cmpfr.mpfr_clear_divby0() + * + * def mpfr_clear_nanflag(): # <<<<<<<<<<<<<< + * """ + * Clear the invalid flag. + */ + __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_clear_nanflag, 3257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(1, 3257, __pyx_L1_error) + + /* "mpfr.pyx":3264 + * cmpfr.mpfr_clear_nanflag() + * + * def mpfr_clear_inexflag(): # <<<<<<<<<<<<<< + * """ + * Clear the inexact flag. + */ + __pyx_codeobj__261 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_clear_inexflag, 3264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) __PYX_ERR(1, 3264, __pyx_L1_error) + + /* "mpfr.pyx":3271 + * cmpfr.mpfr_clear_inexflag() + * + * def mpfr_clear_erangeflag(): # <<<<<<<<<<<<<< + * """ + * Clear the erange flag. + */ + __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_clear_erangeflag, 3271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(1, 3271, __pyx_L1_error) + + /* "mpfr.pyx":3278 + * cmpfr.mpfr_clear_erangeflag() + * + * def mpfr_set_underflow(): # <<<<<<<<<<<<<< + * """ + * Set the underflow flag. + */ + __pyx_codeobj__263 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_underflow, 3278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__263)) __PYX_ERR(1, 3278, __pyx_L1_error) + + /* "mpfr.pyx":3285 + * cmpfr.mpfr_set_underflow() + * + * def mpfr_set_overflow(): # <<<<<<<<<<<<<< + * """ + * Set the overflow flag. + */ + __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_overflow, 3285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(1, 3285, __pyx_L1_error) + + /* "mpfr.pyx":3292 + * cmpfr.mpfr_set_overflow() + * + * def mpfr_set_divby0(): # <<<<<<<<<<<<<< + * """ + * Set the divide-by-zero flag. + */ + __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_divby0, 3292, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(1, 3292, __pyx_L1_error) + + /* "mpfr.pyx":3299 + * cmpfr.mpfr_set_divby0() + * + * def mpfr_set_nanflag(): # <<<<<<<<<<<<<< + * """ + * Set the invalid flag. + */ + __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_nanflag, 3299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(1, 3299, __pyx_L1_error) + + /* "mpfr.pyx":3306 + * cmpfr.mpfr_set_nanflag() + * + * def mpfr_set_inexflag(): # <<<<<<<<<<<<<< + * """ + * Set the inexact flag. + */ + __pyx_codeobj__267 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_inexflag, 3306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__267)) __PYX_ERR(1, 3306, __pyx_L1_error) + + /* "mpfr.pyx":3313 + * cmpfr.mpfr_set_inexflag() + * + * def mpfr_set_erangeflag(): # <<<<<<<<<<<<<< + * """ + * Set the erange flag. + */ + __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_set_erangeflag, 3313, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(1, 3313, __pyx_L1_error) + + /* "mpfr.pyx":3320 + * cmpfr.mpfr_set_erangeflag() + * + * def mpfr_clear_flags(): # <<<<<<<<<<<<<< + * """ + * Clear all global flags. + */ + __pyx_codeobj__269 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_clear_flags, 3320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__269)) __PYX_ERR(1, 3320, __pyx_L1_error) + + /* "mpfr.pyx":3327 + * cmpfr.mpfr_clear_flags() + * + * def mpfr_underflow_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the underflow flag is set, else False. + */ + __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_underflow_p, 3327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(1, 3327, __pyx_L1_error) + + /* "mpfr.pyx":3334 + * return bool(cmpfr.mpfr_underflow_p()) + * + * def mpfr_overflow_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the overflow flag is set, else False. + */ + __pyx_codeobj__271 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_overflow_p, 3334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(1, 3334, __pyx_L1_error) + + /* "mpfr.pyx":3341 + * return bool(cmpfr.mpfr_overflow_p()) + * + * def mpfr_divby0_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the divide-by-zero flag is set, else False. + */ + __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_divby0_p, 3341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(1, 3341, __pyx_L1_error) + + /* "mpfr.pyx":3348 + * return bool(cmpfr.mpfr_divby0_p()) + * + * def mpfr_nanflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the invalid flag is set, else False. + */ + __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_nanflag_p, 3348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(1, 3348, __pyx_L1_error) + + /* "mpfr.pyx":3355 + * return bool(cmpfr.mpfr_nanflag_p()) + * + * def mpfr_inexflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the inexact flag is set, else False. + */ + __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_inexflag_p, 3355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(1, 3355, __pyx_L1_error) + + /* "mpfr.pyx":3362 + * return bool(cmpfr.mpfr_inexflag_p()) + * + * def mpfr_erangeflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the erange flag is set, else False. + */ + __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_erangeflag_p, 3362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(1, 3362, __pyx_L1_error) + + /* "mpfr.pyx":3369 + * return bool(cmpfr.mpfr_erangeflag_p()) + * + * def mpfr_flags_clear(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Clear (lower) the group of flags specified by mask. + */ + __pyx_tuple__276 = PyTuple_Pack(1, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(1, 3369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__276); + __Pyx_GIVEREF(__pyx_tuple__276); + __pyx_codeobj__277 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_flags_clear, 3369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(1, 3369, __pyx_L1_error) + + /* "mpfr.pyx":3377 + * cmpfr.mpfr_flags_clear(mask) + * + * def mpfr_flags_set(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Set (raise) the group of flags specified by mask. + */ + __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_flags_set, 3377, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) __PYX_ERR(1, 3377, __pyx_L1_error) + + /* "mpfr.pyx":3385 + * cmpfr.mpfr_flags_set(mask) + * + * def mpfr_flags_test(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Return the flags specified by mask. + */ + __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_flags_test, 3385, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(1, 3385, __pyx_L1_error) + + /* "mpfr.pyx":3393 + * return cmpfr.mpfr_flags_test(mask) + * + * def mpfr_flags_save(): # <<<<<<<<<<<<<< + * """ + * Return all the flags. This is equivalent to mpfr_flags_test(MPFR_FLAGS_ALL) + */ + __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_flags_save, 3393, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(1, 3393, __pyx_L1_error) + + /* "mpfr.pyx":3400 + * return cmpfr.mpfr_flags_save() + * + * def mpfr_flags_restore(cmpfr.mpfr_flags_t flags, cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Set the current flag state from an integer. + */ + __pyx_tuple__281 = PyTuple_Pack(2, __pyx_n_s_flags, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(1, 3400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__281); + __Pyx_GIVEREF(__pyx_tuple__281); + __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mpfr_pyx, __pyx_n_s_mpfr_flags_restore, 3400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(1, 3400, __pyx_L1_error) + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} +/* #### Code section: init_constants ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { + __pyx_umethod_PyBytes_Type_split.type = (PyObject*)&PyBytes_Type; + __pyx_umethod_PyBytes_Type_split.method_name = &__pyx_n_s_split; + if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error); + __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(1, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_globals ### */ + +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { + return 0; +} +/* #### Code section: init_module ### */ + +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ + +static int __Pyx_modinit_global_init_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); + /*--- Global init code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); + /*--- Variable export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_export_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); + /*--- Function export code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_type_init_code(void) { + __Pyx_RefNannyDeclarations + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); + /*--- Type init code ---*/ + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_4mpfr_Mpz_t = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4mpfr_Mpz_t_spec, NULL); if (unlikely(!__pyx_ptype_4mpfr_Mpz_t)) __PYX_ERR(1, 40, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4mpfr_Mpz_t_spec, __pyx_ptype_4mpfr_Mpz_t) < 0) __PYX_ERR(1, 40, __pyx_L1_error) + #else + __pyx_ptype_4mpfr_Mpz_t = &__pyx_type_4mpfr_Mpz_t; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_4mpfr_Mpz_t) < 0) __PYX_ERR(1, 40, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_4mpfr_Mpz_t->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4mpfr_Mpz_t->tp_dictoffset && __pyx_ptype_4mpfr_Mpz_t->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_4mpfr_Mpz_t->tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #endif + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Mpz_t, (PyObject *) __pyx_ptype_4mpfr_Mpz_t) < 0) __PYX_ERR(1, 40, __pyx_L1_error) + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4mpfr_Mpz_t) < 0) __PYX_ERR(1, 40, __pyx_L1_error) + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_4mpfr_Mpfr_t = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_4mpfr_Mpfr_t_spec, NULL); if (unlikely(!__pyx_ptype_4mpfr_Mpfr_t)) __PYX_ERR(1, 329, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_4mpfr_Mpfr_t_spec, __pyx_ptype_4mpfr_Mpfr_t) < 0) __PYX_ERR(1, 329, __pyx_L1_error) + #else + __pyx_ptype_4mpfr_Mpfr_t = &__pyx_type_4mpfr_Mpfr_t; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_4mpfr_Mpfr_t) < 0) __PYX_ERR(1, 329, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_4mpfr_Mpfr_t->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_4mpfr_Mpfr_t->tp_dictoffset && __pyx_ptype_4mpfr_Mpfr_t->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_4mpfr_Mpfr_t->tp_getattro = __Pyx_PyObject_GenericGetAttr; + } + #endif + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Mpfr_t, (PyObject *) __pyx_ptype_4mpfr_Mpfr_t) < 0) __PYX_ERR(1, 329, __pyx_L1_error) + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_4mpfr_Mpfr_t) < 0) __PYX_ERR(1, 329, __pyx_L1_error) + #endif + __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; + __Pyx_RefNannyFinishContext(); + return -1; +} + +static int __Pyx_modinit_type_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); + /*--- Type import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_variable_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); + /*--- Variable import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + +static int __Pyx_modinit_function_import_code(void) { + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); + /*--- Function import code ---*/ + __Pyx_RefNannyFinishContext(); + return 0; +} + + +#if PY_MAJOR_VERSION >= 3 +#if CYTHON_PEP489_MULTI_PHASE_INIT +static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ +static int __pyx_pymod_exec_mpfr(PyObject* module); /*proto*/ +static PyModuleDef_Slot __pyx_moduledef_slots[] = { + {Py_mod_create, (void*)__pyx_pymod_create}, + {Py_mod_exec, (void*)__pyx_pymod_exec_mpfr}, + {0, NULL} +}; +#endif + +#ifdef __cplusplus +namespace { + struct PyModuleDef __pyx_moduledef = + #else + static struct PyModuleDef __pyx_moduledef = + #endif + { + PyModuleDef_HEAD_INIT, + "mpfr", + 0, /* m_doc */ + #if CYTHON_PEP489_MULTI_PHASE_INIT + 0, /* m_size */ + #elif CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstate), /* m_size */ + #else + -1, /* m_size */ + #endif + __pyx_methods /* m_methods */, + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_moduledef_slots, /* m_slots */ + #else + NULL, /* m_reload */ + #endif + #if CYTHON_USE_MODULE_STATE + __pyx_m_traverse, /* m_traverse */ + __pyx_m_clear, /* m_clear */ + NULL /* m_free */ + #else + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ + #endif + }; + #ifdef __cplusplus +} /* anonymous namespace */ +#endif +#endif + +#ifndef CYTHON_NO_PYINIT_EXPORT +#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#elif PY_MAJOR_VERSION < 3 +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" void +#else +#define __Pyx_PyMODINIT_FUNC void +#endif +#else +#ifdef __cplusplus +#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * +#else +#define __Pyx_PyMODINIT_FUNC PyObject * +#endif +#endif + + +#if PY_MAJOR_VERSION < 3 +__Pyx_PyMODINIT_FUNC initmpfr(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC initmpfr(void) +#else +__Pyx_PyMODINIT_FUNC PyInit_mpfr(void) CYTHON_SMALL_CODE; /*proto*/ +__Pyx_PyMODINIT_FUNC PyInit_mpfr(void) +#if CYTHON_PEP489_MULTI_PHASE_INIT +{ + return PyModuleDef_Init(&__pyx_moduledef); +} +static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { + #if PY_VERSION_HEX >= 0x030700A1 + static PY_INT64_T main_interpreter_id = -1; + PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); + if (main_interpreter_id == -1) { + main_interpreter_id = current_id; + return (unlikely(current_id == -1)) ? -1 : 0; + } else if (unlikely(main_interpreter_id != current_id)) + #else + static PyInterpreterState *main_interpreter = NULL; + PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; + if (!main_interpreter) { + main_interpreter = current_interpreter; + } else if (unlikely(main_interpreter != current_interpreter)) + #endif + { + PyErr_SetString( + PyExc_ImportError, + "Interpreter change detected - this module can only be loaded into one interpreter per process."); + return -1; + } + return 0; +} +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) +#else +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) +#endif +{ + PyObject *value = PyObject_GetAttrString(spec, from_name); + int result = 0; + if (likely(value)) { + if (allow_none || value != Py_None) { +#if CYTHON_COMPILING_IN_LIMITED_API + result = PyModule_AddObject(module, to_name, value); +#else + result = PyDict_SetItemString(moddict, to_name, value); +#endif + } + Py_DECREF(value); + } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + } else { + result = -1; + } + return result; +} +static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { + PyObject *module = NULL, *moddict, *modname; + CYTHON_UNUSED_VAR(def); + if (__Pyx_check_single_interpreter()) + return NULL; + if (__pyx_m) + return __Pyx_NewRef(__pyx_m); + modname = PyObject_GetAttrString(spec, "name"); + if (unlikely(!modname)) goto bad; + module = PyModule_NewObject(modname); + Py_DECREF(modname); + if (unlikely(!module)) goto bad; +#if CYTHON_COMPILING_IN_LIMITED_API + moddict = module; +#else + moddict = PyModule_GetDict(module); + if (unlikely(!moddict)) goto bad; +#endif + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; + if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; + return module; +bad: + Py_XDECREF(module); + return NULL; +} + + +static CYTHON_SMALL_CODE int __pyx_pymod_exec_mpfr(PyObject *__pyx_pyinit_module) +#endif +#endif +{ + int stringtab_initialized = 0; + #if CYTHON_USE_MODULE_STATE + int pystate_addmodule_run = 0; + #endif + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + mpfr_free_cache_t __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations + #if CYTHON_PEP489_MULTI_PHASE_INIT + if (__pyx_m) { + if (__pyx_m == __pyx_pyinit_module) return 0; + PyErr_SetString(PyExc_RuntimeError, "Module 'mpfr' has already been imported. Re-initialisation is not supported."); + return -1; + } + #elif PY_MAJOR_VERSION >= 3 + if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif + /*--- Module creation code ---*/ + #if CYTHON_PEP489_MULTI_PHASE_INIT + __pyx_m = __pyx_pyinit_module; + Py_INCREF(__pyx_m); + #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("mpfr", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) + #elif CYTHON_USE_MODULE_STATE + __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) + { + int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "mpfr" pseudovariable */ + if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) + pystate_addmodule_run = 1; + } + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #endif + CYTHON_UNUSED_VAR(__pyx_t_1); + __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); + __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #if CYTHON_REFNANNY +__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +if (!__Pyx_RefNanny) { + PyErr_Clear(); + __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); + if (!__Pyx_RefNanny) + Py_FatalError("failed to import 'refnanny' module"); +} +#endif + __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_mpfr(void)", 0); + if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #ifdef __Pxy_PyFrame_Initialize_Offsets + __Pxy_PyFrame_Initialize_Offsets(); + #endif + __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED + if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED + if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED + if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED + if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_AsyncGen_USED + if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED + if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ + #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS + PyEval_InitThreads(); + #endif + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) + if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main_mpfr) { + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { + PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "mpfr")) { + if (unlikely((PyDict_SetItemString(modules, "mpfr", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ + if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + /*--- Constants init code ---*/ + if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + /*--- Global type/function init code ---*/ + (void)__Pyx_modinit_global_init_code(); + (void)__Pyx_modinit_variable_export_code(); + (void)__Pyx_modinit_function_export_code(); + if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error) + (void)__Pyx_modinit_type_import_code(); + (void)__Pyx_modinit_variable_import_code(); + (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) + if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) + #endif + + /* "mpfr.pyx":28 + * cimport cmpfr + * + * import sys # <<<<<<<<<<<<<< + * import warnings + * + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(1, 28, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":29 + * + * import sys + * import warnings # <<<<<<<<<<<<<< + * + * cdef extern from "limits.h": + */ + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(1, 29, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_5Mpz_t_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Mpz_t___reduce_cython, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" + */ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_5Mpz_t_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Mpz_t___setstate_cython, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":55 + * + * + * def mpz_set_str(Mpz_t rop not None, object s, int base): # <<<<<<<<<<<<<< + * """ + * Set rop from a string. + */ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_1mpz_set_str, 0, __pyx_n_s_mpz_set_str, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpz_set_str, __pyx_t_2) < 0) __PYX_ERR(1, 55, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":86 + * + * + * def mpz_get_str(int base, Mpz_t op not None): # <<<<<<<<<<<<<< + * """ + * Convert to a string of digits in a given base. + */ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_3mpz_get_str, 0, __pyx_n_s_mpz_get_str, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpz_get_str, __pyx_t_2) < 0) __PYX_ERR(1, 86, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":136 + * # Make integer limits available to Python. These are the limits of + * # values accepted by functions like e.g., mpfr_set_si. + * _LONG_MAX = LONG_MAX # <<<<<<<<<<<<<< + * _LONG_MIN = LONG_MIN + * _ULONG_MAX = ULONG_MAX + */ + __pyx_t_2 = __Pyx_PyInt_From_long(LONG_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LONG_MAX, __pyx_t_2) < 0) __PYX_ERR(1, 136, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":137 + * # values accepted by functions like e.g., mpfr_set_si. + * _LONG_MAX = LONG_MAX + * _LONG_MIN = LONG_MIN # <<<<<<<<<<<<<< + * _ULONG_MAX = ULONG_MAX + * + */ + __pyx_t_2 = __Pyx_PyInt_From_long(LONG_MIN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_LONG_MIN, __pyx_t_2) < 0) __PYX_ERR(1, 137, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":138 + * _LONG_MAX = LONG_MAX + * _LONG_MIN = LONG_MIN + * _ULONG_MAX = ULONG_MAX # <<<<<<<<<<<<<< + * + * # Make precision limits available to Python + */ + __pyx_t_2 = __Pyx_PyInt_From_unsigned_long(ULONG_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ULONG_MAX, __pyx_t_2) < 0) __PYX_ERR(1, 138, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":141 + * + * # Make precision limits available to Python + * MPFR_PREC_MIN = cmpfr.MPFR_PREC_MIN # <<<<<<<<<<<<<< + * MPFR_PREC_MAX = cmpfr.MPFR_PREC_MAX + * + */ + __pyx_t_2 = __Pyx_PyInt_From_mpfr_prec_t(MPFR_PREC_MIN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 141, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_PREC_MIN, __pyx_t_2) < 0) __PYX_ERR(1, 141, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":142 + * # Make precision limits available to Python + * MPFR_PREC_MIN = cmpfr.MPFR_PREC_MIN + * MPFR_PREC_MAX = cmpfr.MPFR_PREC_MAX # <<<<<<<<<<<<<< + * + * # Make rounding mode values available to Python + */ + __pyx_t_2 = __Pyx_PyInt_From_mpfr_prec_t(MPFR_PREC_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_PREC_MAX, __pyx_t_2) < 0) __PYX_ERR(1, 142, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":145 + * + * # Make rounding mode values available to Python + * MPFR_RNDN = cmpfr.MPFR_RNDN # <<<<<<<<<<<<<< + * MPFR_RNDZ = cmpfr.MPFR_RNDZ + * MPFR_RNDU = cmpfr.MPFR_RNDU + */ + __pyx_t_2 = __Pyx_PyInt_From_mpfr_rnd_t(MPFR_RNDN); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 145, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_RNDN, __pyx_t_2) < 0) __PYX_ERR(1, 145, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":146 + * # Make rounding mode values available to Python + * MPFR_RNDN = cmpfr.MPFR_RNDN + * MPFR_RNDZ = cmpfr.MPFR_RNDZ # <<<<<<<<<<<<<< + * MPFR_RNDU = cmpfr.MPFR_RNDU + * MPFR_RNDD = cmpfr.MPFR_RNDD + */ + __pyx_t_2 = __Pyx_PyInt_From_mpfr_rnd_t(MPFR_RNDZ); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_RNDZ, __pyx_t_2) < 0) __PYX_ERR(1, 146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":147 + * MPFR_RNDN = cmpfr.MPFR_RNDN + * MPFR_RNDZ = cmpfr.MPFR_RNDZ + * MPFR_RNDU = cmpfr.MPFR_RNDU # <<<<<<<<<<<<<< + * MPFR_RNDD = cmpfr.MPFR_RNDD + * MPFR_RNDA = cmpfr.MPFR_RNDA + */ + __pyx_t_2 = __Pyx_PyInt_From_mpfr_rnd_t(MPFR_RNDU); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_RNDU, __pyx_t_2) < 0) __PYX_ERR(1, 147, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":148 + * MPFR_RNDZ = cmpfr.MPFR_RNDZ + * MPFR_RNDU = cmpfr.MPFR_RNDU + * MPFR_RNDD = cmpfr.MPFR_RNDD # <<<<<<<<<<<<<< + * MPFR_RNDA = cmpfr.MPFR_RNDA + * MPFR_RNDF = cmpfr.MPFR_RNDF + */ + __pyx_t_2 = __Pyx_PyInt_From_mpfr_rnd_t(MPFR_RNDD); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_RNDD, __pyx_t_2) < 0) __PYX_ERR(1, 148, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":149 + * MPFR_RNDU = cmpfr.MPFR_RNDU + * MPFR_RNDD = cmpfr.MPFR_RNDD + * MPFR_RNDA = cmpfr.MPFR_RNDA # <<<<<<<<<<<<<< + * MPFR_RNDF = cmpfr.MPFR_RNDF + * + */ + __pyx_t_2 = __Pyx_PyInt_From_mpfr_rnd_t(MPFR_RNDA); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_RNDA, __pyx_t_2) < 0) __PYX_ERR(1, 149, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":150 + * MPFR_RNDD = cmpfr.MPFR_RNDD + * MPFR_RNDA = cmpfr.MPFR_RNDA + * MPFR_RNDF = cmpfr.MPFR_RNDF # <<<<<<<<<<<<<< + * + * # Free cache policy (for mpfr_free_cache2) + */ + __pyx_t_2 = __Pyx_PyInt_From_mpfr_rnd_t(MPFR_RNDF); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_RNDF, __pyx_t_2) < 0) __PYX_ERR(1, 150, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":153 + * + * # Free cache policy (for mpfr_free_cache2) + * MPFR_FREE_LOCAL_CACHE = cmpfr.MPFR_FREE_LOCAL_CACHE # <<<<<<<<<<<<<< + * MPFR_FREE_GLOBAL_CACHE = cmpfr.MPFR_FREE_GLOBAL_CACHE + * cdef cmpfr.mpfr_free_cache_t MPFR_FREE_CACHE_ALL = ( + */ + __pyx_t_2 = __Pyx_PyInt_From_mpfr_free_cache_t(MPFR_FREE_LOCAL_CACHE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_FREE_LOCAL_CACHE, __pyx_t_2) < 0) __PYX_ERR(1, 153, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":154 + * # Free cache policy (for mpfr_free_cache2) + * MPFR_FREE_LOCAL_CACHE = cmpfr.MPFR_FREE_LOCAL_CACHE + * MPFR_FREE_GLOBAL_CACHE = cmpfr.MPFR_FREE_GLOBAL_CACHE # <<<<<<<<<<<<<< + * cdef cmpfr.mpfr_free_cache_t MPFR_FREE_CACHE_ALL = ( + * MPFR_FREE_GLOBAL_CACHE | MPFR_FREE_LOCAL_CACHE) + */ + __pyx_t_2 = __Pyx_PyInt_From_mpfr_free_cache_t(MPFR_FREE_GLOBAL_CACHE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_FREE_GLOBAL_CACHE, __pyx_t_2) < 0) __PYX_ERR(1, 154, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "mpfr.pyx":156 + * MPFR_FREE_GLOBAL_CACHE = cmpfr.MPFR_FREE_GLOBAL_CACHE + * cdef cmpfr.mpfr_free_cache_t MPFR_FREE_CACHE_ALL = ( + * MPFR_FREE_GLOBAL_CACHE | MPFR_FREE_LOCAL_CACHE) # <<<<<<<<<<<<<< + * + * # Default values for Emax and Emin + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_MPFR_FREE_GLOBAL_CACHE); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MPFR_FREE_LOCAL_CACHE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Or(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = ((mpfr_free_cache_t)__Pyx_PyInt_As_mpfr_free_cache_t(__pyx_t_4)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 156, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_4mpfr_MPFR_FREE_CACHE_ALL = __pyx_t_5; + + /* "mpfr.pyx":159 + * + * # Default values for Emax and Emin + * MPFR_EMAX_DEFAULT = cmpfr.MPFR_EMAX_DEFAULT # <<<<<<<<<<<<<< + * MPFR_EMIN_DEFAULT = cmpfr.MPFR_EMIN_DEFAULT + * + */ + __pyx_t_4 = __Pyx_PyInt_From_mp_exp_t(MPFR_EMAX_DEFAULT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_EMAX_DEFAULT, __pyx_t_4) < 0) __PYX_ERR(1, 159, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":160 + * # Default values for Emax and Emin + * MPFR_EMAX_DEFAULT = cmpfr.MPFR_EMAX_DEFAULT + * MPFR_EMIN_DEFAULT = cmpfr.MPFR_EMIN_DEFAULT # <<<<<<<<<<<<<< + * + * # Make flag values available to Python + */ + __pyx_t_4 = __Pyx_PyInt_From_mp_exp_t(MPFR_EMIN_DEFAULT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_EMIN_DEFAULT, __pyx_t_4) < 0) __PYX_ERR(1, 160, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":163 + * + * # Make flag values available to Python + * MPFR_FLAGS_UNDERFLOW = cmpfr.MPFR_FLAGS_UNDERFLOW # <<<<<<<<<<<<<< + * MPFR_FLAGS_OVERFLOW = cmpfr.MPFR_FLAGS_OVERFLOW + * MPFR_FLAGS_NAN = cmpfr.MPFR_FLAGS_NAN + */ + __pyx_t_4 = __Pyx_PyInt_From_mpfr_flags_t(MPFR_FLAGS_UNDERFLOW); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 163, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_FLAGS_UNDERFLOW, __pyx_t_4) < 0) __PYX_ERR(1, 163, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":164 + * # Make flag values available to Python + * MPFR_FLAGS_UNDERFLOW = cmpfr.MPFR_FLAGS_UNDERFLOW + * MPFR_FLAGS_OVERFLOW = cmpfr.MPFR_FLAGS_OVERFLOW # <<<<<<<<<<<<<< + * MPFR_FLAGS_NAN = cmpfr.MPFR_FLAGS_NAN + * MPFR_FLAGS_INEXACT = cmpfr.MPFR_FLAGS_INEXACT + */ + __pyx_t_4 = __Pyx_PyInt_From_mpfr_flags_t(MPFR_FLAGS_OVERFLOW); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 164, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_FLAGS_OVERFLOW, __pyx_t_4) < 0) __PYX_ERR(1, 164, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":165 + * MPFR_FLAGS_UNDERFLOW = cmpfr.MPFR_FLAGS_UNDERFLOW + * MPFR_FLAGS_OVERFLOW = cmpfr.MPFR_FLAGS_OVERFLOW + * MPFR_FLAGS_NAN = cmpfr.MPFR_FLAGS_NAN # <<<<<<<<<<<<<< + * MPFR_FLAGS_INEXACT = cmpfr.MPFR_FLAGS_INEXACT + * MPFR_FLAGS_ERANGE = cmpfr.MPFR_FLAGS_ERANGE + */ + __pyx_t_4 = __Pyx_PyInt_From_mpfr_flags_t(MPFR_FLAGS_NAN); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 165, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_FLAGS_NAN, __pyx_t_4) < 0) __PYX_ERR(1, 165, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":166 + * MPFR_FLAGS_OVERFLOW = cmpfr.MPFR_FLAGS_OVERFLOW + * MPFR_FLAGS_NAN = cmpfr.MPFR_FLAGS_NAN + * MPFR_FLAGS_INEXACT = cmpfr.MPFR_FLAGS_INEXACT # <<<<<<<<<<<<<< + * MPFR_FLAGS_ERANGE = cmpfr.MPFR_FLAGS_ERANGE + * MPFR_FLAGS_DIVBY0 = cmpfr.MPFR_FLAGS_DIVBY0 + */ + __pyx_t_4 = __Pyx_PyInt_From_mpfr_flags_t(MPFR_FLAGS_INEXACT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_FLAGS_INEXACT, __pyx_t_4) < 0) __PYX_ERR(1, 166, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":167 + * MPFR_FLAGS_NAN = cmpfr.MPFR_FLAGS_NAN + * MPFR_FLAGS_INEXACT = cmpfr.MPFR_FLAGS_INEXACT + * MPFR_FLAGS_ERANGE = cmpfr.MPFR_FLAGS_ERANGE # <<<<<<<<<<<<<< + * MPFR_FLAGS_DIVBY0 = cmpfr.MPFR_FLAGS_DIVBY0 + * MPFR_FLAGS_ALL = cmpfr.MPFR_FLAGS_ALL + */ + __pyx_t_4 = __Pyx_PyInt_From_mpfr_flags_t(MPFR_FLAGS_ERANGE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 167, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_FLAGS_ERANGE, __pyx_t_4) < 0) __PYX_ERR(1, 167, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":168 + * MPFR_FLAGS_INEXACT = cmpfr.MPFR_FLAGS_INEXACT + * MPFR_FLAGS_ERANGE = cmpfr.MPFR_FLAGS_ERANGE + * MPFR_FLAGS_DIVBY0 = cmpfr.MPFR_FLAGS_DIVBY0 # <<<<<<<<<<<<<< + * MPFR_FLAGS_ALL = cmpfr.MPFR_FLAGS_ALL + * + */ + __pyx_t_4 = __Pyx_PyInt_From_mpfr_flags_t(MPFR_FLAGS_DIVBY0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 168, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_FLAGS_DIVBY0, __pyx_t_4) < 0) __PYX_ERR(1, 168, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":169 + * MPFR_FLAGS_ERANGE = cmpfr.MPFR_FLAGS_ERANGE + * MPFR_FLAGS_DIVBY0 = cmpfr.MPFR_FLAGS_DIVBY0 + * MPFR_FLAGS_ALL = cmpfr.MPFR_FLAGS_ALL # <<<<<<<<<<<<<< + * + * + */ + __pyx_t_4 = __Pyx_PyInt_From_mpfr_flags_t(MPFR_FLAGS_ALL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 169, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_FLAGS_ALL, __pyx_t_4) < 0) __PYX_ERR(1, 169, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "(tree fragment)":1 + * def __reduce_cython__(self): # <<<<<<<<<<<<<< + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + * def __setstate_cython__(self, __pyx_state): + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_6Mpfr_t_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Mpfr_t___reduce_cython, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "(tree fragment)":3 + * def __reduce_cython__(self): + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< + * raise TypeError, "self._value cannot be converted to a Python object for pickling" + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_6Mpfr_t_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Mpfr_t___setstate_cython, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_4) < 0) __PYX_ERR(0, 3, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":352 + * ############################################################################### + * + * def mpfr_initialized_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op has been initialized. Return False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_5mpfr_initialized_p, 0, __pyx_n_s_mpfr_initialized_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 352, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_initialized_p, __pyx_t_4) < 0) __PYX_ERR(1, 352, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":364 + * ############################################################################### + * + * def mpfr_init2(Mpfr_t x not None, cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Initialize x, set its precision to be prec bits and its value to NaN. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_7mpfr_init2, 0, __pyx_n_s_mpfr_init2, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 364, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_init2, __pyx_t_4) < 0) __PYX_ERR(1, 364, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":379 + * cmpfr.mpfr_init2(&x._value, prec) + * + * def mpfr_inits2(cmpfr.mpfr_prec_t prec, *args): # <<<<<<<<<<<<<< + * """ + * Initialize each of the variables in args: set its precision to prec bits + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_9mpfr_inits2, 0, __pyx_n_s_mpfr_inits2, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_inits2, __pyx_t_4) < 0) __PYX_ERR(1, 379, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":389 + * mpfr_init2(arg, prec) + * + * def mpfr_clear(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Free the space occupied by the significand of x. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_11mpfr_clear, 0, __pyx_n_s_mpfr_clear, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_clear, __pyx_t_4) < 0) __PYX_ERR(1, 389, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":400 + * cmpfr.mpfr_clear(&x._value) + * + * def mpfr_clears(*args): # <<<<<<<<<<<<<< + * """ + * Free the space occupied by each of the variables in args. See mpfr_clear + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_13mpfr_clears, 0, __pyx_n_s_mpfr_clears, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_clears, __pyx_t_4) < 0) __PYX_ERR(1, 400, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":409 + * mpfr_clear(arg) + * + * def mpfr_init(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Initialize x, set its precision to the default precision, and set its value + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_15mpfr_init, 0, __pyx_n_s_mpfr_init, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_init, __pyx_t_4) < 0) __PYX_ERR(1, 409, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":422 + * cmpfr.mpfr_init(&x._value) + * + * def mpfr_inits(*args): # <<<<<<<<<<<<<< + * """ + * Initialize each of the variables in args: set its precision to the default + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_17mpfr_inits, 0, __pyx_n_s_mpfr_inits, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_inits, __pyx_t_4) < 0) __PYX_ERR(1, 422, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":435 + * mpfr_init(arg) + * + * def mpfr_set_default_prec(cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Set the default precision to be exactly prec bits. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_19mpfr_set_default_prec, 0, __pyx_n_s_mpfr_set_default_prec, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 435, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_default_prec, __pyx_t_4) < 0) __PYX_ERR(1, 435, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":449 + * cmpfr.mpfr_set_default_prec(prec) + * + * def mpfr_get_default_prec(): # <<<<<<<<<<<<<< + * """ + * Return the current default MPFR precision in bits. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_21mpfr_get_default_prec, 0, __pyx_n_s_mpfr_get_default_prec, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 449, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_default_prec, __pyx_t_4) < 0) __PYX_ERR(1, 449, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":456 + * return cmpfr.mpfr_get_default_prec() + * + * def mpfr_set_prec(Mpfr_t x not None, cmpfr.mpfr_prec_t prec): # <<<<<<<<<<<<<< + * """ + * Reset precision of x. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_23mpfr_set_prec, 0, __pyx_n_s_mpfr_set_prec, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_prec, __pyx_t_4) < 0) __PYX_ERR(1, 456, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":473 + * cmpfr.mpfr_set_prec(&x._value, prec) + * + * def mpfr_get_prec(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Return the precision of x + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_25mpfr_get_prec, 0, __pyx_n_s_mpfr_get_prec, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_prec, __pyx_t_4) < 0) __PYX_ERR(1, 473, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":488 + * ############################################################################### + * + * def mpfr_set(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop from op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_27mpfr_set, 0, __pyx_n_s_mpfr_set, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set, __pyx_t_4) < 0) __PYX_ERR(1, 488, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":501 + * return cmpfr.mpfr_set(&rop._value, &op._value, rnd) + * + * def mpfr_set_ui(Mpfr_t rop not None, unsigned long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_29mpfr_set_ui, 0, __pyx_n_s_mpfr_set_ui, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_ui, __pyx_t_4) < 0) __PYX_ERR(1, 501, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":515 + * return cmpfr.mpfr_set_ui(&rop._value, op, rnd) + * + * def mpfr_set_si(Mpfr_t rop not None, long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from an integer, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_31mpfr_set_si, 0, __pyx_n_s_mpfr_set_si, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_si, __pyx_t_4) < 0) __PYX_ERR(1, 515, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":528 + * return cmpfr.mpfr_set_si(&rop._value, op, rnd) + * + * def mpfr_set_d(Mpfr_t rop not None, double op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from a Python float op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_33mpfr_set_d, 0, __pyx_n_s_mpfr_set_d, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_d, __pyx_t_4) < 0) __PYX_ERR(1, 528, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":547 + * return cmpfr.mpfr_set_d(&rop._value, op, rnd) + * + * def mpfr_set_z(Mpfr_t rop not None, Mpz_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from a GMP integer op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_35mpfr_set_z, 0, __pyx_n_s_mpfr_set_z, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 547, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_z, __pyx_t_4) < 0) __PYX_ERR(1, 547, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":559 + * return cmpfr.mpfr_set_z(&rop._value, &op._value, rnd) + * + * def mpfr_set_ui_2exp(Mpfr_t rop not None, unsigned long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_37mpfr_set_ui_2exp, 0, __pyx_n_s_mpfr_set_ui_2exp, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_ui_2exp, __pyx_t_4) < 0) __PYX_ERR(1, 559, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":573 + * return cmpfr.mpfr_set_ui_2exp(&rop._value, op, e, rnd) + * + * def mpfr_set_si_2exp(Mpfr_t rop not None, long int op, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_39mpfr_set_si_2exp, 0, __pyx_n_s_mpfr_set_si_2exp, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_si_2exp, __pyx_t_4) < 0) __PYX_ERR(1, 573, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":587 + * return cmpfr.mpfr_set_si_2exp(&rop._value, op, e, rnd) + * + * def mpfr_set_z_2exp(Mpfr_t rop not None, Mpz_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_exp_t e, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_41mpfr_set_z_2exp, 0, __pyx_n_s_mpfr_set_z_2exp, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_z_2exp, __pyx_t_4) < 0) __PYX_ERR(1, 587, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":600 + * return cmpfr.mpfr_set_z_2exp(&rop._value, &op._value, e, rnd) + * + * def mpfr_set_str(Mpfr_t rop not None, object s, int base, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop from a string s. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_43mpfr_set_str, 0, __pyx_n_s_mpfr_set_str, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_str, __pyx_t_4) < 0) __PYX_ERR(1, 600, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":622 + * return cmpfr.mpfr_set_str(&rop._value, bytes_s, base, rnd) + * + * def mpfr_strtofr(Mpfr_t rop not None, object s, int base, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Read a floating-point number from a string. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_45mpfr_strtofr, 0, __pyx_n_s_mpfr_strtofr, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 622, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_strtofr, __pyx_t_4) < 0) __PYX_ERR(1, 622, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":702 + * return ternary, endindex + * + * def mpfr_set_nan(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ Set x to a NaN. + * + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_47mpfr_set_nan, 0, __pyx_n_s_mpfr_set_nan, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_nan, __pyx_t_4) < 0) __PYX_ERR(1, 702, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":712 + * cmpfr.mpfr_set_nan(&op._value) + * + * def mpfr_set_inf(Mpfr_t op not None, int sign): # <<<<<<<<<<<<<< + * """ Set x to an infinity. + * + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_49mpfr_set_inf, 0, __pyx_n_s_mpfr_set_inf, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_inf, __pyx_t_4) < 0) __PYX_ERR(1, 712, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":726 + * cmpfr.mpfr_set_inf(&op._value, sign) + * + * def mpfr_set_zero(Mpfr_t op not None, int sign): # <<<<<<<<<<<<<< + * """ Set x to a zero. + * + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_51mpfr_set_zero, 0, __pyx_n_s_mpfr_set_zero, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 726, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_zero, __pyx_t_4) < 0) __PYX_ERR(1, 726, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":740 + * cmpfr.mpfr_set_zero(&op._value, sign) + * + * def mpfr_swap(Mpfr_t x not None, Mpfr_t y not None): # <<<<<<<<<<<<<< + * """ + * Swap the values of x and y efficiently. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_53mpfr_swap, 0, __pyx_n_s_mpfr_swap, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_swap, __pyx_t_4) < 0) __PYX_ERR(1, 740, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":758 + * ############################################################################### + * + * def mpfr_get_d(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to a Python float. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_55mpfr_get_d, 0, __pyx_n_s_mpfr_get_d, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_d, __pyx_t_4) < 0) __PYX_ERR(1, 758, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":773 + * return cmpfr.mpfr_get_d(&op._value, rnd) + * + * def mpfr_get_si(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to an integer that's within the range of a C long. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_57mpfr_get_si, 0, __pyx_n_s_mpfr_get_si, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 773, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_si, __pyx_t_4) < 0) __PYX_ERR(1, 773, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":788 + * return cmpfr.mpfr_get_si(&op._value, rnd) + * + * def mpfr_get_ui(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to an integer that's within the range of a C unsigned long. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_59mpfr_get_ui, 0, __pyx_n_s_mpfr_get_ui, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_ui, __pyx_t_4) < 0) __PYX_ERR(1, 788, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":803 + * return cmpfr.mpfr_get_ui(&op._value, rnd) + * + * def mpfr_get_d_2exp(Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert op to a Python float and an exponent. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_61mpfr_get_d_2exp, 0, __pyx_n_s_mpfr_get_d_2exp, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_d_2exp, __pyx_t_4) < 0) __PYX_ERR(1, 803, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":824 + * return d, exp + * + * def mpfr_frexp(Mpfr_t y not None, Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """Decompose 'x' in the form 2**e * y. + * + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_63mpfr_frexp, 0, __pyx_n_s_mpfr_frexp, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 824, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_frexp, __pyx_t_4) < 0) __PYX_ERR(1, 824, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":843 + * return ternary, exp + * + * def mpfr_get_z_2exp(Mpz_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Decompose as a product of an integer and a power of two. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_65mpfr_get_z_2exp, 0, __pyx_n_s_mpfr_get_z_2exp, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 843, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_z_2exp, __pyx_t_4) < 0) __PYX_ERR(1, 843, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":865 + * return exponent + * + * def mpfr_get_z(Mpz_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Convert to a GMP integer. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_67mpfr_get_z, 0, __pyx_n_s_mpfr_get_z, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_z, __pyx_t_4) < 0) __PYX_ERR(1, 865, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":881 + * return cmpfr.mpfr_get_z(&rop._value, &op._value, rnd) + * + * def mpfr_get_str(int b, size_t n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Compute a base 'b' string representation for 'op'. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_69mpfr_get_str, 0, __pyx_n_s_mpfr_get_str, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_str, __pyx_t_4) < 0) __PYX_ERR(1, 881, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":943 + * return digits.decode('ascii'), exp + * + * def mpfr_fits_ulong_p(Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return True if op would fit into a C unsigned long int. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_71mpfr_fits_ulong_p, 0, __pyx_n_s_mpfr_fits_ulong_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 943, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_fits_ulong_p, __pyx_t_4) < 0) __PYX_ERR(1, 943, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":955 + * return bool(cmpfr.mpfr_fits_ulong_p(&x._value, rnd)) + * + * def mpfr_fits_slong_p(Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return True if op would fit into a C long int. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_73mpfr_fits_slong_p, 0, __pyx_n_s_mpfr_fits_slong_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_fits_slong_p, __pyx_t_4) < 0) __PYX_ERR(1, 955, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":972 + * ############################################################################### + * + * def mpfr_add(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_75mpfr_add, 0, __pyx_n_s_mpfr_add, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_add, __pyx_t_4) < 0) __PYX_ERR(1, 972, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":984 + * return cmpfr.mpfr_add(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sub(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_77mpfr_sub, 0, __pyx_n_s_mpfr_sub, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 984, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_sub, __pyx_t_4) < 0) __PYX_ERR(1, 984, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":996 + * return cmpfr.mpfr_sub(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_mul(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_79mpfr_mul, 0, __pyx_n_s_mpfr_mul, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_mul, __pyx_t_4) < 0) __PYX_ERR(1, 996, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1008 + * return cmpfr.mpfr_mul(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sqr(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the square of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_81mpfr_sqr, 0, __pyx_n_s_mpfr_sqr, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_sqr, __pyx_t_4) < 0) __PYX_ERR(1, 1008, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1018 + * return cmpfr.mpfr_sqr(&rop._value, &op._value, rnd) + * + * def mpfr_div(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_83mpfr_div, 0, __pyx_n_s_mpfr_div, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_div, __pyx_t_4) < 0) __PYX_ERR(1, 1018, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1030 + * return cmpfr.mpfr_div(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_sqrt(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the square root of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_85mpfr_sqrt, 0, __pyx_n_s_mpfr_sqrt, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_sqrt, __pyx_t_4) < 0) __PYX_ERR(1, 1030, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1043 + * return cmpfr.mpfr_sqrt(&rop._value, &op._value, rnd) + * + * def mpfr_rec_sqrt(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_87mpfr_rec_sqrt, 0, __pyx_n_s_mpfr_rec_sqrt, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1043, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_rec_sqrt, __pyx_t_4) < 0) __PYX_ERR(1, 1043, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1056 + * return cmpfr.mpfr_rec_sqrt(&rop._value, &op._value, rnd) + * + * def mpfr_cbrt(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cube root of op rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_89mpfr_cbrt, 0, __pyx_n_s_mpfr_cbrt, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_cbrt, __pyx_t_4) < 0) __PYX_ERR(1, 1056, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1069 + * return cmpfr.mpfr_cbrt(&rop._value, &op._value, rnd) + * + * def mpfr_rootn_ui(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_91mpfr_rootn_ui, 0, __pyx_n_s_mpfr_rootn_ui, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_rootn_ui, __pyx_t_4) < 0) __PYX_ERR(1, 1069, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1088 + * return cmpfr.mpfr_rootn_ui(&rop._value, &op._value, k, rnd) + * + * def mpfr_root(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_93mpfr_root, 0, __pyx_n_s_mpfr_root, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_root, __pyx_t_4) < 0) __PYX_ERR(1, 1088, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1112 + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + * + * def _mpfr_root_no_warn(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * unsigned long int k, cmpfr.mpfr_rnd_t rnd): + * + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_95_mpfr_root_no_warn, 0, __pyx_n_s_mpfr_root_no_warn, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_root_no_warn, __pyx_t_4) < 0) __PYX_ERR(1, 1112, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1126 + * return cmpfr.mpfr_root(&rop._value, &op._value, k, rnd) + * + * def mpfr_pow(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_97mpfr_pow, 0, __pyx_n_s_mpfr_pow, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_pow, __pyx_t_4) < 0) __PYX_ERR(1, 1126, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1175 + * return cmpfr.mpfr_pow(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_neg(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to -op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_99mpfr_neg, 0, __pyx_n_s_mpfr_neg, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_neg, __pyx_t_4) < 0) __PYX_ERR(1, 1175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1189 + * return cmpfr.mpfr_neg(&rop._value, &op._value, rnd) + * + * def mpfr_abs(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the absolute value of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_101mpfr_abs, 0, __pyx_n_s_mpfr_abs, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_abs, __pyx_t_4) < 0) __PYX_ERR(1, 1189, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1203 + * return cmpfr.mpfr_abs(&rop._value, &op._value, rnd) + * + * def mpfr_dim(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_103mpfr_dim, 0, __pyx_n_s_mpfr_dim, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1203, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_dim, __pyx_t_4) < 0) __PYX_ERR(1, 1203, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1223 + * ############################################################################### + * + * def mpfr_cmp(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Perform a three-way comparison of op1 and op2. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_105mpfr_cmp, 0, __pyx_n_s_mpfr_cmp, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1223, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_cmp, __pyx_t_4) < 0) __PYX_ERR(1, 1223, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1243 + * return cmpfr.mpfr_cmp(&op1._value, &op2._value) + * + * def mpfr_cmpabs(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Compare the absolute values of op1 and op2. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_107mpfr_cmpabs, 0, __pyx_n_s_mpfr_cmpabs, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_cmpabs, __pyx_t_4) < 0) __PYX_ERR(1, 1243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1256 + * return cmpfr.mpfr_cmpabs(&op1._value, &op2._value) + * + * def mpfr_nan_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is a NaN. Return False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_109mpfr_nan_p, 0, __pyx_n_s_mpfr_nan_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_nan_p, __pyx_t_4) < 0) __PYX_ERR(1, 1256, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1264 + * return bool(cmpfr.mpfr_nan_p(&op._value)) + * + * def mpfr_inf_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an infinity. Return False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_111mpfr_inf_p, 0, __pyx_n_s_mpfr_inf_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_inf_p, __pyx_t_4) < 0) __PYX_ERR(1, 1264, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1272 + * return bool(cmpfr.mpfr_inf_p(&op._value)) + * + * def mpfr_number_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an ordinary number. Return False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_113mpfr_number_p, 0, __pyx_n_s_mpfr_number_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1272, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_number_p, __pyx_t_4) < 0) __PYX_ERR(1, 1272, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1282 + * return bool(cmpfr.mpfr_number_p(&op._value)) + * + * def mpfr_zero_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is zero. Return False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_115mpfr_zero_p, 0, __pyx_n_s_mpfr_zero_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1282, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_zero_p, __pyx_t_4) < 0) __PYX_ERR(1, 1282, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1290 + * return bool(cmpfr.mpfr_zero_p(&op._value)) + * + * def mpfr_regular_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is a regular number. Return False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_117mpfr_regular_p, 0, __pyx_n_s_mpfr_regular_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_regular_p, __pyx_t_4) < 0) __PYX_ERR(1, 1290, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1301 + * return bool(cmpfr.mpfr_regular_p(&op._value)) + * + * def mpfr_sgn(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return the sign of op. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_119mpfr_sgn, 0, __pyx_n_s_mpfr_sgn, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1301, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_sgn, __pyx_t_4) < 0) __PYX_ERR(1, 1301, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1313 + * return cmpfr.mpfr_sgn(&op._value) + * + * def mpfr_greater_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 > op2 and False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_121mpfr_greater_p, 0, __pyx_n_s_mpfr_greater_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_greater_p, __pyx_t_4) < 0) __PYX_ERR(1, 1313, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1324 + * return bool(cmpfr.mpfr_greater_p(&op1._value, &op2._value)) + * + * def mpfr_greaterequal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 >= op2 and False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_123mpfr_greaterequal_p, 0, __pyx_n_s_mpfr_greaterequal_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1324, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_greaterequal_p, __pyx_t_4) < 0) __PYX_ERR(1, 1324, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1335 + * return bool(cmpfr.mpfr_greaterequal_p(&op1._value, &op2._value)) + * + * def mpfr_less_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 < op2 and False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_125mpfr_less_p, 0, __pyx_n_s_mpfr_less_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1335, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_less_p, __pyx_t_4) < 0) __PYX_ERR(1, 1335, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1346 + * return bool(cmpfr.mpfr_less_p(&op1._value, &op2._value)) + * + * def mpfr_lessequal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 <= op2 and False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_127mpfr_lessequal_p, 0, __pyx_n_s_mpfr_lessequal_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_lessequal_p, __pyx_t_4) < 0) __PYX_ERR(1, 1346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1357 + * return bool(cmpfr.mpfr_lessequal_p(&op1._value, &op2._value)) + * + * def mpfr_equal_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 == op2 and False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_129mpfr_equal_p, 0, __pyx_n_s_mpfr_equal_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_equal_p, __pyx_t_4) < 0) __PYX_ERR(1, 1357, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1368 + * return bool(cmpfr.mpfr_equal_p(&op1._value, &op2._value)) + * + * def mpfr_lessgreater_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 < op2 or op1 > op2 and False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_131mpfr_lessgreater_p, 0, __pyx_n_s_mpfr_lessgreater_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1368, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_lessgreater_p, __pyx_t_4) < 0) __PYX_ERR(1, 1368, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1379 + * return bool(cmpfr.mpfr_lessgreater_p(&op1._value, &op2._value)) + * + * def mpfr_unordered_p(Mpfr_t op1 not None, Mpfr_t op2 not None): # <<<<<<<<<<<<<< + * """ + * Return True if op1 or op2 is a NaN and False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_133mpfr_unordered_p, 0, __pyx_n_s_mpfr_unordered_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1379, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_unordered_p, __pyx_t_4) < 0) __PYX_ERR(1, 1379, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1393 + * ############################################################################### + * + * def mpfr_log(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the natural logarithm of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_135mpfr_log, 0, __pyx_n_s_mpfr_log, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_log, __pyx_t_4) < 0) __PYX_ERR(1, 1393, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1403 + * return cmpfr.mpfr_log(&rop._value, &op._value, rnd) + * + * def mpfr_log_ui(Mpfr_t rop not None, unsigned long op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the natural logarithm of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_137mpfr_log_ui, 0, __pyx_n_s_mpfr_log_ui, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_log_ui, __pyx_t_4) < 0) __PYX_ERR(1, 1403, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1412 + * return cmpfr.mpfr_log_ui(&rop._value, op, rnd) + * + * def mpfr_log2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the base-two logarithm of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_139mpfr_log2, 0, __pyx_n_s_mpfr_log2, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1412, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_log2, __pyx_t_4) < 0) __PYX_ERR(1, 1412, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1422 + * return cmpfr.mpfr_log2(&rop._value, &op._value, rnd) + * + * def mpfr_log10(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the base-ten logarithm of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_141mpfr_log10, 0, __pyx_n_s_mpfr_log10, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1422, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_log10, __pyx_t_4) < 0) __PYX_ERR(1, 1422, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1432 + * return cmpfr.mpfr_log10(&rop._value, &op._value, rnd) + * + * def mpfr_log1p(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the logarithm of one plus op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_143mpfr_log1p, 0, __pyx_n_s_mpfr_log1p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1432, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_log1p, __pyx_t_4) < 0) __PYX_ERR(1, 1432, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1442 + * return cmpfr.mpfr_log1p(&rop._value, &op._value, rnd) + * + * def mpfr_exp(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_145mpfr_exp, 0, __pyx_n_s_mpfr_exp, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_exp, __pyx_t_4) < 0) __PYX_ERR(1, 1442, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1452 + * return cmpfr.mpfr_exp(&rop._value, &op._value, rnd) + * + * def mpfr_exp2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to two raised to the power op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_147mpfr_exp2, 0, __pyx_n_s_mpfr_exp2, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_exp2, __pyx_t_4) < 0) __PYX_ERR(1, 1452, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1462 + * return cmpfr.mpfr_exp2(&rop._value, &op._value, rnd) + * + * def mpfr_exp10(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to ten raised to the power op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_149mpfr_exp10, 0, __pyx_n_s_mpfr_exp10, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1462, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_exp10, __pyx_t_4) < 0) __PYX_ERR(1, 1462, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1472 + * return cmpfr.mpfr_exp10(&rop._value, &op._value, rnd) + * + * def mpfr_expm1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential of op followed by a subtraction by one, rounded + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_151mpfr_expm1, 0, __pyx_n_s_mpfr_expm1, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_expm1, __pyx_t_4) < 0) __PYX_ERR(1, 1472, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1483 + * return cmpfr.mpfr_expm1(&rop._value, &op._value, rnd) + * + * def mpfr_cos(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cosine of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_153mpfr_cos, 0, __pyx_n_s_mpfr_cos, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_cos, __pyx_t_4) < 0) __PYX_ERR(1, 1483, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1493 + * return cmpfr.mpfr_cos(&rop._value, &op._value, rnd) + * + * def mpfr_sin(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the sine of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_155mpfr_sin, 0, __pyx_n_s_mpfr_sin, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_sin, __pyx_t_4) < 0) __PYX_ERR(1, 1493, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1503 + * return cmpfr.mpfr_sin(&rop._value, &op._value, rnd) + * + * def mpfr_tan(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the tangent of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_157mpfr_tan, 0, __pyx_n_s_mpfr_tan, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_tan, __pyx_t_4) < 0) __PYX_ERR(1, 1503, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1513 + * return cmpfr.mpfr_tan(&rop._value, &op._value, rnd) + * + * def mpfr_sin_cos(Mpfr_t sop not None, Mpfr_t cop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_159mpfr_sin_cos, 0, __pyx_n_s_mpfr_sin_cos, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1513, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_sin_cos, __pyx_t_4) < 0) __PYX_ERR(1, 1513, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1538 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_sec(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the secant of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_161mpfr_sec, 0, __pyx_n_s_mpfr_sec, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_sec, __pyx_t_4) < 0) __PYX_ERR(1, 1538, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1548 + * return cmpfr.mpfr_sec(&rop._value, &op._value, rnd) + * + * def mpfr_csc(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cosecant of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_163mpfr_csc, 0, __pyx_n_s_mpfr_csc, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_csc, __pyx_t_4) < 0) __PYX_ERR(1, 1548, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1558 + * return cmpfr.mpfr_csc(&rop._value, &op._value, rnd) + * + * def mpfr_cot(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the cotangent of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_165mpfr_cot, 0, __pyx_n_s_mpfr_cot, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_cot, __pyx_t_4) < 0) __PYX_ERR(1, 1558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1568 + * return cmpfr.mpfr_cot(&rop._value, &op._value, rnd) + * + * def mpfr_acos(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-cosine of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_167mpfr_acos, 0, __pyx_n_s_mpfr_acos, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1568, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_acos, __pyx_t_4) < 0) __PYX_ERR(1, 1568, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1584 + * return cmpfr.mpfr_acos(&rop._value, &op._value, rnd) + * + * def mpfr_asin(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-sine of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_169mpfr_asin, 0, __pyx_n_s_mpfr_asin, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1584, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_asin, __pyx_t_4) < 0) __PYX_ERR(1, 1584, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1600 + * return cmpfr.mpfr_asin(&rop._value, &op._value, rnd) + * + * def mpfr_atan(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the arc-tangent of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_171mpfr_atan, 0, __pyx_n_s_mpfr_atan, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_atan, __pyx_t_4) < 0) __PYX_ERR(1, 1600, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1616 + * return cmpfr.mpfr_atan(&rop._value, &op._value, rnd) + * + * def mpfr_atan2(Mpfr_t rop not None, Mpfr_t y not None, # <<<<<<<<<<<<<< + * Mpfr_t x not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_173mpfr_atan2, 0, __pyx_n_s_mpfr_atan2, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1616, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_atan2, __pyx_t_4) < 0) __PYX_ERR(1, 1616, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1659 + * return cmpfr.mpfr_atan2(&rop._value, &y._value, &x._value, rnd) + * + * def mpfr_cosh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cosine of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_175mpfr_cosh, 0, __pyx_n_s_mpfr_cosh, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1659, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_cosh, __pyx_t_4) < 0) __PYX_ERR(1, 1659, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1669 + * return cmpfr.mpfr_cosh(&rop._value, &op._value, rnd) + * + * def mpfr_sinh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic sine of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_177mpfr_sinh, 0, __pyx_n_s_mpfr_sinh, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_sinh, __pyx_t_4) < 0) __PYX_ERR(1, 1669, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1679 + * return cmpfr.mpfr_sinh(&rop._value, &op._value, rnd) + * + * def mpfr_tanh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic tangent of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_179mpfr_tanh, 0, __pyx_n_s_mpfr_tanh, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1679, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_tanh, __pyx_t_4) < 0) __PYX_ERR(1, 1679, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1689 + * return cmpfr.mpfr_tanh(&rop._value, &op._value, rnd) + * + * def mpfr_sinh_cosh(Mpfr_t sop not None, Mpfr_t cop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_181mpfr_sinh_cosh, 0, __pyx_n_s_mpfr_sinh_cosh, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1689, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_sinh_cosh, __pyx_t_4) < 0) __PYX_ERR(1, 1689, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1714 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_sech(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic secant of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_183mpfr_sech, 0, __pyx_n_s_mpfr_sech, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1714, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_sech, __pyx_t_4) < 0) __PYX_ERR(1, 1714, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1724 + * return cmpfr.mpfr_sech(&rop._value, &op._value, rnd) + * + * def mpfr_csch(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cosecant of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_185mpfr_csch, 0, __pyx_n_s_mpfr_csch, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_csch, __pyx_t_4) < 0) __PYX_ERR(1, 1724, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1734 + * return cmpfr.mpfr_csch(&rop._value, &op._value, rnd) + * + * def mpfr_coth(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the hyperbolic cotangent of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_187mpfr_coth, 0, __pyx_n_s_mpfr_coth, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1734, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_coth, __pyx_t_4) < 0) __PYX_ERR(1, 1734, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1744 + * return cmpfr.mpfr_coth(&rop._value, &op._value, rnd) + * + * def mpfr_acosh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic cosine of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_189mpfr_acosh, 0, __pyx_n_s_mpfr_acosh, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1744, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_acosh, __pyx_t_4) < 0) __PYX_ERR(1, 1744, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1754 + * return cmpfr.mpfr_acosh(&rop._value, &op._value, rnd) + * + * def mpfr_asinh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic sine of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_191mpfr_asinh, 0, __pyx_n_s_mpfr_asinh, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1754, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_asinh, __pyx_t_4) < 0) __PYX_ERR(1, 1754, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1764 + * return cmpfr.mpfr_asinh(&rop._value, &op._value, rnd) + * + * def mpfr_atanh(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the inverse hyperbolic tangent of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_193mpfr_atanh, 0, __pyx_n_s_mpfr_atanh, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1764, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_atanh, __pyx_t_4) < 0) __PYX_ERR(1, 1764, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1774 + * return cmpfr.mpfr_atanh(&rop._value, &op._value, rnd) + * + * def mpfr_fac_ui(Mpfr_t rop not None, unsigned long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the factorial of op, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_195mpfr_fac_ui, 0, __pyx_n_s_mpfr_fac_ui, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1774, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_fac_ui, __pyx_t_4) < 0) __PYX_ERR(1, 1774, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1783 + * return cmpfr.mpfr_fac_ui(&rop._value, op, rnd) + * + * def mpfr_eint(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the exponential integral of op, rounded in the direction + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_197mpfr_eint, 0, __pyx_n_s_mpfr_eint, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1783, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_eint, __pyx_t_4) < 0) __PYX_ERR(1, 1783, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1799 + * return cmpfr.mpfr_eint(&rop._value, &op._value, rnd) + * + * def mpfr_li2(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to real part of the dilogarithm of op, rounded in the direction + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_199mpfr_li2, 0, __pyx_n_s_mpfr_li2, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1799, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_li2, __pyx_t_4) < 0) __PYX_ERR(1, 1799, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1813 + * return cmpfr.mpfr_li2(&rop._value, &op._value, rnd) + * + * def mpfr_gamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Gamma function on op, rounded in the direction + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_201mpfr_gamma, 0, __pyx_n_s_mpfr_gamma, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_gamma, __pyx_t_4) < 0) __PYX_ERR(1, 1813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1826 + * return cmpfr.mpfr_gamma(&rop._value, &op._value, rnd) + * + * def mpfr_gamma_inc(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_203mpfr_gamma_inc, 0, __pyx_n_s_mpfr_gamma_inc, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_gamma_inc, __pyx_t_4) < 0) __PYX_ERR(1, 1826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1842 + * return cmpfr.mpfr_gamma_inc(&rop._value, &op._value, &op2._value, rnd) + * + * def mpfr_lngamma(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_205mpfr_lngamma, 0, __pyx_n_s_mpfr_lngamma, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1842, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_lngamma, __pyx_t_4) < 0) __PYX_ERR(1, 1842, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1857 + * return cmpfr.mpfr_lngamma(&rop._value, &op._value, rnd) + * + * def mpfr_lgamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the logarithm of the absolute value of the Gamma + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_207mpfr_lgamma, 0, __pyx_n_s_mpfr_lgamma, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1857, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_lgamma, __pyx_t_4) < 0) __PYX_ERR(1, 1857, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1880 + * return ternary, signp + * + * def mpfr_digamma(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Digamma (sometimes also called Psi) function on + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_209mpfr_digamma, 0, __pyx_n_s_mpfr_digamma, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_digamma, __pyx_t_4) < 0) __PYX_ERR(1, 1880, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1893 + * return cmpfr.mpfr_digamma(&rop._value, &op._value, rnd) + * + * def mpfr_beta(Mpfr_t rop not None, Mpfr_t op1 not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_211mpfr_beta, 0, __pyx_n_s_mpfr_beta, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1893, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_beta, __pyx_t_4) < 0) __PYX_ERR(1, 1893, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1905 + * return cmpfr.mpfr_beta(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_zeta(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Riemann Zeta function on op, rounded in the + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_213mpfr_zeta, 0, __pyx_n_s_mpfr_zeta, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1905, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_zeta, __pyx_t_4) < 0) __PYX_ERR(1, 1905, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1916 + * return cmpfr.mpfr_zeta(&rop._value, &op._value, rnd) + * + * def mpfr_zeta_ui(Mpfr_t rop not None, unsigned long int op, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Riemann Zeta function on op, rounded in the + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_215mpfr_zeta_ui, 0, __pyx_n_s_mpfr_zeta_ui, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_zeta_ui, __pyx_t_4) < 0) __PYX_ERR(1, 1916, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1926 + * return cmpfr.mpfr_zeta_ui(&rop._value, op, rnd) + * + * def mpfr_erf(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the error function on op, rounded in the direction + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_217mpfr_erf, 0, __pyx_n_s_mpfr_erf, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_erf, __pyx_t_4) < 0) __PYX_ERR(1, 1926, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1937 + * return cmpfr.mpfr_erf(&rop._value, &op._value, rnd) + * + * def mpfr_erfc(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the the complementary error function on op, rounded + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_219mpfr_erfc, 0, __pyx_n_s_mpfr_erfc, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__155)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1937, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_erfc, __pyx_t_4) < 0) __PYX_ERR(1, 1937, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1948 + * return cmpfr.mpfr_erfc(&rop._value, &op._value, rnd) + * + * def mpfr_j0(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order 0 on op, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_221mpfr_j0, 0, __pyx_n_s_mpfr_j0, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1948, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_j0, __pyx_t_4) < 0) __PYX_ERR(1, 1948, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1960 + * return cmpfr.mpfr_j0(&rop._value, &op._value, rnd) + * + * def mpfr_j1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order 1, on op, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_223mpfr_j1, 0, __pyx_n_s_mpfr_j1, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1960, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_j1, __pyx_t_4) < 0) __PYX_ERR(1, 1960, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1973 + * return cmpfr.mpfr_j1(&rop._value, &op._value, rnd) + * + * def mpfr_jn(Mpfr_t rop not None, long int n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the first kind Bessel function of order n on op, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_225mpfr_jn, 0, __pyx_n_s_mpfr_jn, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1973, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_jn, __pyx_t_4) < 0) __PYX_ERR(1, 1973, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1987 + * return cmpfr.mpfr_jn(&rop._value, n, &op._value, rnd) + * + * def mpfr_y0(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order 0 on op, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_227mpfr_y0, 0, __pyx_n_s_mpfr_y0, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_y0, __pyx_t_4) < 0) __PYX_ERR(1, 1987, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2002 + * return cmpfr.mpfr_y0(&rop._value, &op._value, rnd) + * + * def mpfr_y1(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order 1 on op, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_229mpfr_y1, 0, __pyx_n_s_mpfr_y1, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_y1, __pyx_t_4) < 0) __PYX_ERR(1, 2002, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2017 + * return cmpfr.mpfr_y1(&rop._value, &op._value, rnd) + * + * def mpfr_yn(Mpfr_t rop not None, long int n, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the second kind Bessel function of order n on op, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_231mpfr_yn, 0, __pyx_n_s_mpfr_yn, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2017, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_yn, __pyx_t_4) < 0) __PYX_ERR(1, 2017, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2030 + * return cmpfr.mpfr_yn(&rop._value, n, &op._value, rnd) + * + * def mpfr_fma(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_233mpfr_fma, 0, __pyx_n_s_mpfr_fma, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2030, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_fma, __pyx_t_4) < 0) __PYX_ERR(1, 2030, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2048 + * ) + * + * def mpfr_fms(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_235mpfr_fms, 0, __pyx_n_s_mpfr_fms, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_fms, __pyx_t_4) < 0) __PYX_ERR(1, 2048, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2066 + * ) + * + * def mpfr_fmma(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_237mpfr_fmma, 0, __pyx_n_s_mpfr_fmma, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_fmma, __pyx_t_4) < 0) __PYX_ERR(1, 2066, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2086 + * ) + * + * def mpfr_fmms(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_239mpfr_fmms, 0, __pyx_n_s_mpfr_fmms, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_fmms, __pyx_t_4) < 0) __PYX_ERR(1, 2086, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2106 + * ) + * + * def mpfr_agm(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t op1 not None, + * Mpfr_t op2 not None, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_241mpfr_agm, 0, __pyx_n_s_mpfr_agm, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_agm, __pyx_t_4) < 0) __PYX_ERR(1, 2106, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2124 + * return cmpfr.mpfr_agm(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_hypot(Mpfr_t rop not None, # <<<<<<<<<<<<<< + * Mpfr_t x not None, + * Mpfr_t y not None, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_243mpfr_hypot, 0, __pyx_n_s_mpfr_hypot, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_hypot, __pyx_t_4) < 0) __PYX_ERR(1, 2124, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2142 + * return cmpfr.mpfr_hypot(&rop._value, &x._value, &y._value, rnd) + * + * def mpfr_ai(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the value of the Airy function Ai on x, rounded in the direction + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_245mpfr_ai, 0, __pyx_n_s_mpfr_ai, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_ai, __pyx_t_4) < 0) __PYX_ERR(1, 2142, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2159 + * return cmpfr.mpfr_ai(&rop._value, &op._value, rnd) + * + * def mpfr_const_log2(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to log(2), rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_247mpfr_const_log2, 0, __pyx_n_s_mpfr_const_log2, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2159, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_const_log2, __pyx_t_4) < 0) __PYX_ERR(1, 2159, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2172 + * return cmpfr.mpfr_const_log2(&rop._value, rnd) + * + * def mpfr_const_pi(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Pi, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_249mpfr_const_pi, 0, __pyx_n_s_mpfr_const_pi, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_const_pi, __pyx_t_4) < 0) __PYX_ERR(1, 2172, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2185 + * return cmpfr.mpfr_const_pi(&rop._value, rnd) + * + * def mpfr_const_euler(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Euler's constant, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_251mpfr_const_euler, 0, __pyx_n_s_mpfr_const_euler, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2185, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_const_euler, __pyx_t_4) < 0) __PYX_ERR(1, 2185, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2199 + * return cmpfr.mpfr_const_euler(&rop._value, rnd) + * + * def mpfr_const_catalan(Mpfr_t rop not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to Catalan's constant, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_253mpfr_const_catalan, 0, __pyx_n_s_mpfr_const_catalan, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_const_catalan, __pyx_t_4) < 0) __PYX_ERR(1, 2199, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2213 + * return cmpfr.mpfr_const_catalan(&rop._value, rnd) + * + * def mpfr_free_cache(): # <<<<<<<<<<<<<< + * """ + * Free internal MPFR caches. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_255mpfr_free_cache, 0, __pyx_n_s_mpfr_free_cache, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_free_cache, __pyx_t_4) < 0) __PYX_ERR(1, 2213, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2226 + * cmpfr.mpfr_free_cache() + * + * def mpfr_free_cache2(cmpfr.mpfr_free_cache_t way): # <<<<<<<<<<<<<< + * """ + * Free various caches and pools used by MPFR internally, as specified by + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_257mpfr_free_cache2, 0, __pyx_n_s_mpfr_free_cache2, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2226, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_free_cache2, __pyx_t_4) < 0) __PYX_ERR(1, 2226, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2241 + * cmpfr.mpfr_free_cache2(way) + * + * def mpfr_free_pool(): # <<<<<<<<<<<<<< + * + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_259mpfr_free_pool, 0, __pyx_n_s_mpfr_free_pool, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_free_pool, __pyx_t_4) < 0) __PYX_ERR(1, 2241, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2250 + * cmpfr.mpfr_free_pool() + * + * def mpfr_mp_memory_cleanup(): # <<<<<<<<<<<<<< + * """ + * This function should be called before calling mp_set_memory_functions. See + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_261mpfr_mp_memory_cleanup, 0, __pyx_n_s_mpfr_mp_memory_cleanup, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_mp_memory_cleanup, __pyx_t_4) < 0) __PYX_ERR(1, 2250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2263 + * "mpfr_mp_memory_cleanup returned nonzero value {}".format(rc)) + * + * def mpfr_sum(Mpfr_t rop not None, tab, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the sum of the elements of tab, rounded in the direction rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_263mpfr_sum, 0, __pyx_n_s_mpfr_sum, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2263, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_sum, __pyx_t_4) < 0) __PYX_ERR(1, 2263, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2310 + * ########################################################################### + * + * def mpfr_asprintf(object template, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Compute a string representation of 'op' based on the given template. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_265mpfr_asprintf, 0, __pyx_n_s_mpfr_asprintf, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2310, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_asprintf, __pyx_t_4) < 0) __PYX_ERR(1, 2310, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2343 + * ############################################################################### + * + * def mpfr_rint(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to an integer in the direction given by rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_267mpfr_rint, 0, __pyx_n_s_mpfr_rint, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_rint, __pyx_t_4) < 0) __PYX_ERR(1, 2343, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2366 + * return cmpfr.mpfr_rint(&rop._value, &op._value, rnd) + * + * def mpfr_ceil(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next higher or equal representable integer. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_269mpfr_ceil, 0, __pyx_n_s_mpfr_ceil, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2366, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_ceil, __pyx_t_4) < 0) __PYX_ERR(1, 2366, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2381 + * return cmpfr.mpfr_ceil(&rop._value, &op._value) + * + * def mpfr_floor(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next lower or equal representable integer. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_271mpfr_floor, 0, __pyx_n_s_mpfr_floor, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2381, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_floor, __pyx_t_4) < 0) __PYX_ERR(1, 2381, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2396 + * return cmpfr.mpfr_floor(&rop._value, &op._value) + * + * def mpfr_round(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the nearest representable integer, rounding + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_273mpfr_round, 0, __pyx_n_s_mpfr_round, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2396, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_round, __pyx_t_4) < 0) __PYX_ERR(1, 2396, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2421 + * return cmpfr.mpfr_round(&rop._value, &op._value) + * + * def mpfr_roundeven(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the nearest representable integer, rounding + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_275mpfr_roundeven, 0, __pyx_n_s_mpfr_roundeven, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__193)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2421, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_roundeven, __pyx_t_4) < 0) __PYX_ERR(1, 2421, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2437 + * return cmpfr.mpfr_roundeven(&rop._value, &op._value) + * + * def mpfr_trunc(Mpfr_t rop not None, Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Set rop to op rounded to the next representable integer toward zero. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_277mpfr_trunc, 0, __pyx_n_s_mpfr_trunc, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2437, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_trunc, __pyx_t_4) < 0) __PYX_ERR(1, 2437, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2452 + * return cmpfr.mpfr_trunc(&rop._value, &op._value) + * + * def mpfr_rint_ceil(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_279mpfr_rint_ceil, 0, __pyx_n_s_mpfr_rint_ceil, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__195)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2452, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_rint_ceil, __pyx_t_4) < 0) __PYX_ERR(1, 2452, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2472 + * return cmpfr.mpfr_rint_ceil(&rop._value, &op._value, rnd) + * + * def mpfr_rint_floor(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_281mpfr_rint_floor, 0, __pyx_n_s_mpfr_rint_floor, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2472, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_rint_floor, __pyx_t_4) < 0) __PYX_ERR(1, 2472, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2492 + * return cmpfr.mpfr_rint_floor(&rop._value, &op._value, rnd) + * + * def mpfr_rint_round(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_283mpfr_rint_round, 0, __pyx_n_s_mpfr_rint_round, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_rint_round, __pyx_t_4) < 0) __PYX_ERR(1, 2492, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2518 + * return cmpfr.mpfr_rint_round(&rop._value, &op._value, rnd) + * + * def mpfr_rint_roundeven(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_285mpfr_rint_roundeven, 0, __pyx_n_s_mpfr_rint_roundeven, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2518, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_rint_roundeven, __pyx_t_4) < 0) __PYX_ERR(1, 2518, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2539 + * return cmpfr.mpfr_rint_roundeven(&rop._value, &op._value, rnd) + * + * def mpfr_rint_trunc(Mpfr_t rop not None, Mpfr_t op not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_287mpfr_rint_trunc, 0, __pyx_n_s_mpfr_rint_trunc, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_rint_trunc, __pyx_t_4) < 0) __PYX_ERR(1, 2539, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2559 + * return cmpfr.mpfr_rint_trunc(&rop._value, &op._value, rnd) + * + * def mpfr_frac(Mpfr_t rop not None, Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set rop to the fractional part of op, having the same sign as op, rounded + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_289mpfr_frac, 0, __pyx_n_s_mpfr_frac, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2559, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_frac, __pyx_t_4) < 0) __PYX_ERR(1, 2559, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2571 + * return cmpfr.mpfr_frac(&rop._value, &op._value, rnd) + * + * def mpfr_modf(Mpfr_t iop not None, Mpfr_t fop not None, # <<<<<<<<<<<<<< + * Mpfr_t op not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_291mpfr_modf, 0, __pyx_n_s_mpfr_modf, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2571, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_modf, __pyx_t_4) < 0) __PYX_ERR(1, 2571, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2597 + * return decode_ternary_pair(ternary_pair) + * + * def mpfr_fmod(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_293mpfr_fmod, 0, __pyx_n_s_mpfr_fmod, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2597, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_fmod, __pyx_t_4) < 0) __PYX_ERR(1, 2597, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2619 + * return cmpfr.mpfr_fmod(&r._value, &x._value, &y._value, rnd) + * + * def mpfr_fmodquo(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_295mpfr_fmodquo, 0, __pyx_n_s_mpfr_fmodquo, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_fmodquo, __pyx_t_4) < 0) __PYX_ERR(1, 2619, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2651 + * return ternary, quotient + * + * def mpfr_remainder(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_297mpfr_remainder, 0, __pyx_n_s_mpfr_remainder, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2651, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_remainder, __pyx_t_4) < 0) __PYX_ERR(1, 2651, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2673 + * return cmpfr.mpfr_remainder(&r._value, &x._value, &y._value, rnd) + * + * def mpfr_remquo(Mpfr_t r not None, Mpfr_t x not None, # <<<<<<<<<<<<<< + * Mpfr_t y not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_299mpfr_remquo, 0, __pyx_n_s_mpfr_remquo, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2673, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_remquo, __pyx_t_4) < 0) __PYX_ERR(1, 2673, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2706 + * return ternary, quotient + * + * def mpfr_integer_p(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op is an integer. Return False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_301mpfr_integer_p, 0, __pyx_n_s_mpfr_integer_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_integer_p, __pyx_t_4) < 0) __PYX_ERR(1, 2706, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2719 + * ############################################################################### + * + * def mpfr_set_default_rounding_mode(cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the default rounding mode to rnd. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_303mpfr_set_default_rounding_mode, 0, __pyx_n_s_mpfr_set_default_rounding_mode, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2719, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_default_rounding_mode, __pyx_t_4) < 0) __PYX_ERR(1, 2719, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2729 + * cmpfr.mpfr_set_default_rounding_mode(rnd) + * + * def mpfr_get_default_rounding_mode(): # <<<<<<<<<<<<<< + * """ + * Get the default rounding mode. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_305mpfr_get_default_rounding_mode, 0, __pyx_n_s_mpfr_get_default_rounding_mode, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_default_rounding_mode, __pyx_t_4) < 0) __PYX_ERR(1, 2729, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2736 + * return cmpfr.mpfr_get_default_rounding_mode() + * + * def mpfr_prec_round( # <<<<<<<<<<<<<< + * Mpfr_t x not None, cmpfr.mpfr_prec_t prec, cmpfr.mpfr_rnd_t rnd + * ): + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_307mpfr_prec_round, 0, __pyx_n_s_mpfr_prec_round, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_prec_round, __pyx_t_4) < 0) __PYX_ERR(1, 2736, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2768 + * return cmpfr.mpfr_prec_round(&x._value, prec, rnd) + * + * def mpfr_can_round(Mpfr_t b not None, cmpfr.mpfr_exp_t err, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd1, cmpfr.mpfr_rnd_t rnd2, + * cmpfr.mpfr_prec_t prec): + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_309mpfr_can_round, 0, __pyx_n_s_mpfr_can_round, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_can_round, __pyx_t_4) < 0) __PYX_ERR(1, 2768, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2802 + * return bool(cmpfr.mpfr_can_round(&b._value, err, rnd1, rnd2, prec)) + * + * def mpfr_min_prec(Mpfr_t x not None): # <<<<<<<<<<<<<< + * """ + * Return the minimal number of bits required to store the significand of x, + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_311mpfr_min_prec, 0, __pyx_n_s_mpfr_min_prec, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__217)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_min_prec, __pyx_t_4) < 0) __PYX_ERR(1, 2802, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2814 + * return cmpfr.mpfr_min_prec(&x._value) + * + * def mpfr_print_rnd_mode(cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Return a string ("MPFR_RNDD", "MPFR_RNDU", "MPFR_RNDN", "MPFR_RNDZ", + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_313mpfr_print_rnd_mode, 0, __pyx_n_s_mpfr_print_rnd_mode, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_print_rnd_mode, __pyx_t_4) < 0) __PYX_ERR(1, 2814, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2834 + * ############################################################################### + * + * def mpfr_nexttoward(Mpfr_t x not None, Mpfr_t y not None): # <<<<<<<<<<<<<< + * """ + * Replace x by the next floating-point number in the direction of y. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_315mpfr_nexttoward, 0, __pyx_n_s_mpfr_nexttoward, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2834, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_nexttoward, __pyx_t_4) < 0) __PYX_ERR(1, 2834, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2850 + * cmpfr.mpfr_nexttoward(&x._value, &y._value) + * + * def mpfr_nextabove(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Equivalent to mpfr_nexttoward(op, y) where y is plus infinity. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_317mpfr_nextabove, 0, __pyx_n_s_mpfr_nextabove, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2850, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_nextabove, __pyx_t_4) < 0) __PYX_ERR(1, 2850, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2858 + * cmpfr.mpfr_nextabove(&op._value) + * + * def mpfr_nextbelow(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Equivalent to mpfr_nexttoward(op, y) where y is minus infinity. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_319mpfr_nextbelow, 0, __pyx_n_s_mpfr_nextbelow, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_nextbelow, __pyx_t_4) < 0) __PYX_ERR(1, 2858, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2866 + * cmpfr.mpfr_nextbelow(&op._value) + * + * def mpfr_min(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_321mpfr_min, 0, __pyx_n_s_mpfr_min, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_min, __pyx_t_4) < 0) __PYX_ERR(1, 2866, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2882 + * return cmpfr.mpfr_min(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_max(Mpfr_t rop not None, Mpfr_t op1 not None, Mpfr_t op2 not None, # <<<<<<<<<<<<<< + * cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_323mpfr_max, 0, __pyx_n_s_mpfr_max, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_max, __pyx_t_4) < 0) __PYX_ERR(1, 2882, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2898 + * return cmpfr.mpfr_max(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_get_exp(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return the exponent of op. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_325mpfr_get_exp, 0, __pyx_n_s_mpfr_get_exp, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2898, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_exp, __pyx_t_4) < 0) __PYX_ERR(1, 2898, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2910 + * return cmpfr.mpfr_get_exp(&op._value) + * + * def mpfr_set_exp(Mpfr_t op not None, cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the exponent of op. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_327mpfr_set_exp, 0, __pyx_n_s_mpfr_set_exp, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_exp, __pyx_t_4) < 0) __PYX_ERR(1, 2910, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2925 + * raise ValueError("exponent not in current exponent range") + * + * def mpfr_signbit(Mpfr_t op not None): # <<<<<<<<<<<<<< + * """ + * Return True if op has its sign bit set. Return False otherwise. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_329mpfr_signbit, 0, __pyx_n_s_mpfr_signbit, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_signbit, __pyx_t_4) < 0) __PYX_ERR(1, 2925, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2936 + * return bool(cmpfr.mpfr_signbit(&op._value)) + * + * def mpfr_setsign(Mpfr_t rop not None, Mpfr_t op not None, s, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Set the value of rop from op and the sign of rop from s. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_331mpfr_setsign, 0, __pyx_n_s_mpfr_setsign, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2936, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_setsign, __pyx_t_4) < 0) __PYX_ERR(1, 2936, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2950 + * return cmpfr.mpfr_setsign(&rop._value, &op._value, s, rnd) + * + * def mpfr_copysign(Mpfr_t rop not None, Mpfr_t op1 not None, # <<<<<<<<<<<<<< + * Mpfr_t op2 not None, cmpfr.mpfr_rnd_t rnd): + * """ + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_333mpfr_copysign, 0, __pyx_n_s_mpfr_copysign, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__231)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2950, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_copysign, __pyx_t_4) < 0) __PYX_ERR(1, 2950, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2966 + * return cmpfr.mpfr_copysign(&rop._value, &op1._value, &op2._value, rnd) + * + * def mpfr_get_version(): # <<<<<<<<<<<<<< + * """ + * Return the MPFR version, as a string. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_335mpfr_get_version, 0, __pyx_n_s_mpfr_get_version, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__233)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2966, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_version, __pyx_t_4) < 0) __PYX_ERR(1, 2966, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2978 + * + * + * MPFR_VERSION = cmpfr.MPFR_VERSION # <<<<<<<<<<<<<< + * MPFR_VERSION_MAJOR = cmpfr.MPFR_VERSION_MAJOR + * MPFR_VERSION_MINOR = cmpfr.MPFR_VERSION_MINOR + */ + __pyx_t_4 = __Pyx_PyInt_From_int(MPFR_VERSION); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_VERSION, __pyx_t_4) < 0) __PYX_ERR(1, 2978, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2979 + * + * MPFR_VERSION = cmpfr.MPFR_VERSION + * MPFR_VERSION_MAJOR = cmpfr.MPFR_VERSION_MAJOR # <<<<<<<<<<<<<< + * MPFR_VERSION_MINOR = cmpfr.MPFR_VERSION_MINOR + * MPFR_VERSION_PATCHLEVEL = cmpfr.MPFR_VERSION_PATCHLEVEL + */ + __pyx_t_4 = __Pyx_PyInt_From_int(MPFR_VERSION_MAJOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2979, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_VERSION_MAJOR, __pyx_t_4) < 0) __PYX_ERR(1, 2979, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2980 + * MPFR_VERSION = cmpfr.MPFR_VERSION + * MPFR_VERSION_MAJOR = cmpfr.MPFR_VERSION_MAJOR + * MPFR_VERSION_MINOR = cmpfr.MPFR_VERSION_MINOR # <<<<<<<<<<<<<< + * MPFR_VERSION_PATCHLEVEL = cmpfr.MPFR_VERSION_PATCHLEVEL + * if sys.version_info < (3,): + */ + __pyx_t_4 = __Pyx_PyInt_From_int(MPFR_VERSION_MINOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_VERSION_MINOR, __pyx_t_4) < 0) __PYX_ERR(1, 2980, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2981 + * MPFR_VERSION_MAJOR = cmpfr.MPFR_VERSION_MAJOR + * MPFR_VERSION_MINOR = cmpfr.MPFR_VERSION_MINOR + * MPFR_VERSION_PATCHLEVEL = cmpfr.MPFR_VERSION_PATCHLEVEL # <<<<<<<<<<<<<< + * if sys.version_info < (3,): + * MPFR_VERSION_STRING = cmpfr.MPFR_VERSION_STRING + */ + __pyx_t_4 = __Pyx_PyInt_From_int(MPFR_VERSION_PATCHLEVEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_VERSION_PATCHLEVEL, __pyx_t_4) < 0) __PYX_ERR(1, 2981, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2982 + * MPFR_VERSION_MINOR = cmpfr.MPFR_VERSION_MINOR + * MPFR_VERSION_PATCHLEVEL = cmpfr.MPFR_VERSION_PATCHLEVEL + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * MPFR_VERSION_STRING = cmpfr.MPFR_VERSION_STRING + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 2982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_tuple__4, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2982, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 2982, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + + /* "mpfr.pyx":2983 + * MPFR_VERSION_PATCHLEVEL = cmpfr.MPFR_VERSION_PATCHLEVEL + * if sys.version_info < (3,): + * MPFR_VERSION_STRING = cmpfr.MPFR_VERSION_STRING # <<<<<<<<<<<<<< + * else: + * MPFR_VERSION_STRING = cmpfr.MPFR_VERSION_STRING.decode('ascii') + */ + __pyx_t_4 = __Pyx_PyBytes_FromString(MPFR_VERSION_STRING); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2983, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_VERSION_STRING, __pyx_t_4) < 0) __PYX_ERR(1, 2983, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2982 + * MPFR_VERSION_MINOR = cmpfr.MPFR_VERSION_MINOR + * MPFR_VERSION_PATCHLEVEL = cmpfr.MPFR_VERSION_PATCHLEVEL + * if sys.version_info < (3,): # <<<<<<<<<<<<<< + * MPFR_VERSION_STRING = cmpfr.MPFR_VERSION_STRING + * else: + */ + goto __pyx_L2; + } + + /* "mpfr.pyx":2985 + * MPFR_VERSION_STRING = cmpfr.MPFR_VERSION_STRING + * else: + * MPFR_VERSION_STRING = cmpfr.MPFR_VERSION_STRING.decode('ascii') # <<<<<<<<<<<<<< + * + * def MPFR_VERSION_NUM(int major, int minor, int patchlevel): + */ + /*else*/ { + __pyx_t_7 = __Pyx_ssize_strlen(MPFR_VERSION_STRING); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 2985, __pyx_L1_error) + __pyx_t_4 = __Pyx_decode_c_string(MPFR_VERSION_STRING, 0, __pyx_t_7, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2985, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_VERSION_STRING, __pyx_t_4) < 0) __PYX_ERR(1, 2985, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_L2:; + + /* "mpfr.pyx":2987 + * MPFR_VERSION_STRING = cmpfr.MPFR_VERSION_STRING.decode('ascii') + * + * def MPFR_VERSION_NUM(int major, int minor, int patchlevel): # <<<<<<<<<<<<<< + * """ + * Create an integer in the same format as used by MPFR_VERSION from the given + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_337MPFR_VERSION_NUM, 0, __pyx_n_s_MPFR_VERSION_NUM, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__235)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPFR_VERSION_NUM, __pyx_t_4) < 0) __PYX_ERR(1, 2987, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":2995 + * return cmpfr.MPFR_VERSION_NUM(major, minor, patchlevel) + * + * def mpfr_get_patches(): # <<<<<<<<<<<<<< + * """ + * Return information about patches applied to the MPFR library. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_339mpfr_get_patches, 0, __pyx_n_s_mpfr_get_patches, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2995, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_patches, __pyx_t_4) < 0) __PYX_ERR(1, 2995, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3014 + * return patches.decode('ascii').split() + * + * def mpfr_buildopt_tls_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled as thread safe using compiler-level Thread + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_341mpfr_buildopt_tls_p, 0, __pyx_n_s_mpfr_buildopt_tls_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3014, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_buildopt_tls_p, __pyx_t_4) < 0) __PYX_ERR(1, 3014, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3023 + * return bool(cmpfr.mpfr_buildopt_tls_p()) + * + * def mpfr_buildopt_float128_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with '__float128' support (that is, MPFR + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_343mpfr_buildopt_float128_p, 0, __pyx_n_s_mpfr_buildopt_float128_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3023, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_buildopt_float128_p, __pyx_t_4) < 0) __PYX_ERR(1, 3023, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3032 + * return bool(cmpfr.mpfr_buildopt_float128_p()) + * + * def mpfr_buildopt_decimal_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with decimal float support (that is, MPFR + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_345mpfr_buildopt_decimal_p, 0, __pyx_n_s_mpfr_buildopt_decimal_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_buildopt_decimal_p, __pyx_t_4) < 0) __PYX_ERR(1, 3032, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3041 + * return bool(cmpfr.mpfr_buildopt_decimal_p()) + * + * def mpfr_buildopt_gmpinternals_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled with GMP internals (that is, MPFR was + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_347mpfr_buildopt_gmpinternals_p, 0, __pyx_n_s_mpfr_buildopt_gmpinternals_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__241)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_buildopt_gmpinternals_p, __pyx_t_4) < 0) __PYX_ERR(1, 3041, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3050 + * return bool(cmpfr.mpfr_buildopt_gmpinternals_p()) + * + * def mpfr_buildopt_sharedcache_p(): # <<<<<<<<<<<<<< + * """ + * Return True if MPFR was compiled so that all threads share the same cache + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_349mpfr_buildopt_sharedcache_p, 0, __pyx_n_s_mpfr_buildopt_sharedcache_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_buildopt_sharedcache_p, __pyx_t_4) < 0) __PYX_ERR(1, 3050, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3061 + * return bool(cmpfr.mpfr_buildopt_sharedcache_p()) + * + * def mpfr_buildopt_tune_case(): # <<<<<<<<<<<<<< + * """ + * Return a string saying which thresholds file has been used at compile + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_351mpfr_buildopt_tune_case, 0, __pyx_n_s_mpfr_buildopt_tune_case, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__244)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3061, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_buildopt_tune_case, __pyx_t_4) < 0) __PYX_ERR(1, 3061, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3079 + * + * + * def mpfr_get_emin(): # <<<<<<<<<<<<<< + * """ + * Return smallest exponent allowed. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_353mpfr_get_emin, 0, __pyx_n_s_mpfr_get_emin, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__245)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_emin, __pyx_t_4) < 0) __PYX_ERR(1, 3079, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3090 + * return cmpfr.mpfr_get_emin() + * + * def mpfr_get_emax(): # <<<<<<<<<<<<<< + * """ + * Return largest exponent allowed. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_355mpfr_get_emax, 0, __pyx_n_s_mpfr_get_emax, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__246)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3090, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_emax, __pyx_t_4) < 0) __PYX_ERR(1, 3090, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3102 + * return cmpfr.mpfr_get_emax() + * + * def mpfr_set_emin(cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the smallest exponent allowed for a floating-point variable. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_357mpfr_set_emin, 0, __pyx_n_s_mpfr_set_emin, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3102, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_emin, __pyx_t_4) < 0) __PYX_ERR(1, 3102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3119 + * raise ValueError("new exponent for emin is outside allowable range") + * + * def mpfr_set_emax(cmpfr.mpfr_exp_t exp): # <<<<<<<<<<<<<< + * """ + * Set the largest exponent allowed for a floating-point variable. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_359mpfr_set_emax, 0, __pyx_n_s_mpfr_set_emax, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__249)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_emax, __pyx_t_4) < 0) __PYX_ERR(1, 3119, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3136 + * raise ValueError("new exponent for emin is outside allowable range") + * + * def mpfr_get_emin_min(): # <<<<<<<<<<<<<< + * """ + * Return the minimum exponent allowed for mpfr_set_emin. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_361mpfr_get_emin_min, 0, __pyx_n_s_mpfr_get_emin_min, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_emin_min, __pyx_t_4) < 0) __PYX_ERR(1, 3136, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3146 + * return cmpfr.mpfr_get_emin_min() + * + * def mpfr_get_emin_max(): # <<<<<<<<<<<<<< + * """ + * Return the maximum exponent allowed for mpfr_set_emin. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_363mpfr_get_emin_max, 0, __pyx_n_s_mpfr_get_emin_max, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__251)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_emin_max, __pyx_t_4) < 0) __PYX_ERR(1, 3146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3156 + * return cmpfr.mpfr_get_emin_max() + * + * def mpfr_get_emax_min(): # <<<<<<<<<<<<<< + * """ + * Return the minimum exponent allowed for mpfr_set_emax. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_365mpfr_get_emax_min, 0, __pyx_n_s_mpfr_get_emax_min, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3156, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_emax_min, __pyx_t_4) < 0) __PYX_ERR(1, 3156, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3166 + * return cmpfr.mpfr_get_emax_min() + * + * def mpfr_get_emax_max(): # <<<<<<<<<<<<<< + * """ + * Return the maximum exponent allowed for mpfr_set_emax. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_367mpfr_get_emax_max, 0, __pyx_n_s_mpfr_get_emax_max, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3166, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_get_emax_max, __pyx_t_4) < 0) __PYX_ERR(1, 3166, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3176 + * return cmpfr.mpfr_get_emax_max() + * + * def mpfr_check_range(Mpfr_t x not None, int t, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Modify x if necessary to fit into the current exponent range. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_369mpfr_check_range, 0, __pyx_n_s_mpfr_check_range, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__255)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3176, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_check_range, __pyx_t_4) < 0) __PYX_ERR(1, 3176, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3205 + * return cmpfr.mpfr_check_range(&x._value, t, rnd) + * + * def mpfr_subnormalize(Mpfr_t x not None, int t, cmpfr.mpfr_rnd_t rnd): # <<<<<<<<<<<<<< + * """ + * Modify x if necessary to account for subnormalization. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_371mpfr_subnormalize, 0, __pyx_n_s_mpfr_subnormalize, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__256)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3205, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_subnormalize, __pyx_t_4) < 0) __PYX_ERR(1, 3205, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3236 + * return cmpfr.mpfr_subnormalize(&x._value, t, rnd) + * + * def mpfr_clear_underflow(): # <<<<<<<<<<<<<< + * """ + * Clear the underflow flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_373mpfr_clear_underflow, 0, __pyx_n_s_mpfr_clear_underflow, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_clear_underflow, __pyx_t_4) < 0) __PYX_ERR(1, 3236, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3243 + * cmpfr.mpfr_clear_underflow() + * + * def mpfr_clear_overflow(): # <<<<<<<<<<<<<< + * """ + * Clear the overflow flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_375mpfr_clear_overflow, 0, __pyx_n_s_mpfr_clear_overflow, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__258)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3243, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_clear_overflow, __pyx_t_4) < 0) __PYX_ERR(1, 3243, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3250 + * cmpfr.mpfr_clear_overflow() + * + * def mpfr_clear_divby0(): # <<<<<<<<<<<<<< + * """ + * Clear the divide-by-zero flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_377mpfr_clear_divby0, 0, __pyx_n_s_mpfr_clear_divby0, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__259)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_clear_divby0, __pyx_t_4) < 0) __PYX_ERR(1, 3250, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3257 + * cmpfr.mpfr_clear_divby0() + * + * def mpfr_clear_nanflag(): # <<<<<<<<<<<<<< + * """ + * Clear the invalid flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_379mpfr_clear_nanflag, 0, __pyx_n_s_mpfr_clear_nanflag, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__260)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3257, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_clear_nanflag, __pyx_t_4) < 0) __PYX_ERR(1, 3257, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3264 + * cmpfr.mpfr_clear_nanflag() + * + * def mpfr_clear_inexflag(): # <<<<<<<<<<<<<< + * """ + * Clear the inexact flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_381mpfr_clear_inexflag, 0, __pyx_n_s_mpfr_clear_inexflag, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__261)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_clear_inexflag, __pyx_t_4) < 0) __PYX_ERR(1, 3264, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3271 + * cmpfr.mpfr_clear_inexflag() + * + * def mpfr_clear_erangeflag(): # <<<<<<<<<<<<<< + * """ + * Clear the erange flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_383mpfr_clear_erangeflag, 0, __pyx_n_s_mpfr_clear_erangeflag, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__262)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3271, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_clear_erangeflag, __pyx_t_4) < 0) __PYX_ERR(1, 3271, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3278 + * cmpfr.mpfr_clear_erangeflag() + * + * def mpfr_set_underflow(): # <<<<<<<<<<<<<< + * """ + * Set the underflow flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_385mpfr_set_underflow, 0, __pyx_n_s_mpfr_set_underflow, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__263)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3278, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_underflow, __pyx_t_4) < 0) __PYX_ERR(1, 3278, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3285 + * cmpfr.mpfr_set_underflow() + * + * def mpfr_set_overflow(): # <<<<<<<<<<<<<< + * """ + * Set the overflow flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_387mpfr_set_overflow, 0, __pyx_n_s_mpfr_set_overflow, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__264)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3285, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_overflow, __pyx_t_4) < 0) __PYX_ERR(1, 3285, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3292 + * cmpfr.mpfr_set_overflow() + * + * def mpfr_set_divby0(): # <<<<<<<<<<<<<< + * """ + * Set the divide-by-zero flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_389mpfr_set_divby0, 0, __pyx_n_s_mpfr_set_divby0, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__265)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_divby0, __pyx_t_4) < 0) __PYX_ERR(1, 3292, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3299 + * cmpfr.mpfr_set_divby0() + * + * def mpfr_set_nanflag(): # <<<<<<<<<<<<<< + * """ + * Set the invalid flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_391mpfr_set_nanflag, 0, __pyx_n_s_mpfr_set_nanflag, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__266)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_nanflag, __pyx_t_4) < 0) __PYX_ERR(1, 3299, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3306 + * cmpfr.mpfr_set_nanflag() + * + * def mpfr_set_inexflag(): # <<<<<<<<<<<<<< + * """ + * Set the inexact flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_393mpfr_set_inexflag, 0, __pyx_n_s_mpfr_set_inexflag, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__267)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3306, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_inexflag, __pyx_t_4) < 0) __PYX_ERR(1, 3306, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3313 + * cmpfr.mpfr_set_inexflag() + * + * def mpfr_set_erangeflag(): # <<<<<<<<<<<<<< + * """ + * Set the erange flag. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_395mpfr_set_erangeflag, 0, __pyx_n_s_mpfr_set_erangeflag, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__268)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3313, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_set_erangeflag, __pyx_t_4) < 0) __PYX_ERR(1, 3313, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3320 + * cmpfr.mpfr_set_erangeflag() + * + * def mpfr_clear_flags(): # <<<<<<<<<<<<<< + * """ + * Clear all global flags. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_397mpfr_clear_flags, 0, __pyx_n_s_mpfr_clear_flags, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__269)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3320, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_clear_flags, __pyx_t_4) < 0) __PYX_ERR(1, 3320, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3327 + * cmpfr.mpfr_clear_flags() + * + * def mpfr_underflow_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the underflow flag is set, else False. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_399mpfr_underflow_p, 0, __pyx_n_s_mpfr_underflow_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__270)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_underflow_p, __pyx_t_4) < 0) __PYX_ERR(1, 3327, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3334 + * return bool(cmpfr.mpfr_underflow_p()) + * + * def mpfr_overflow_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the overflow flag is set, else False. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_401mpfr_overflow_p, 0, __pyx_n_s_mpfr_overflow_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__271)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3334, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_overflow_p, __pyx_t_4) < 0) __PYX_ERR(1, 3334, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3341 + * return bool(cmpfr.mpfr_overflow_p()) + * + * def mpfr_divby0_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the divide-by-zero flag is set, else False. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_403mpfr_divby0_p, 0, __pyx_n_s_mpfr_divby0_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__272)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_divby0_p, __pyx_t_4) < 0) __PYX_ERR(1, 3341, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3348 + * return bool(cmpfr.mpfr_divby0_p()) + * + * def mpfr_nanflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the invalid flag is set, else False. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_405mpfr_nanflag_p, 0, __pyx_n_s_mpfr_nanflag_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__273)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3348, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_nanflag_p, __pyx_t_4) < 0) __PYX_ERR(1, 3348, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3355 + * return bool(cmpfr.mpfr_nanflag_p()) + * + * def mpfr_inexflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the inexact flag is set, else False. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_407mpfr_inexflag_p, 0, __pyx_n_s_mpfr_inexflag_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3355, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_inexflag_p, __pyx_t_4) < 0) __PYX_ERR(1, 3355, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3362 + * return bool(cmpfr.mpfr_inexflag_p()) + * + * def mpfr_erangeflag_p(): # <<<<<<<<<<<<<< + * """ + * Return True if the erange flag is set, else False. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_409mpfr_erangeflag_p, 0, __pyx_n_s_mpfr_erangeflag_p, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__275)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3362, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_erangeflag_p, __pyx_t_4) < 0) __PYX_ERR(1, 3362, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3369 + * return bool(cmpfr.mpfr_erangeflag_p()) + * + * def mpfr_flags_clear(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Clear (lower) the group of flags specified by mask. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_411mpfr_flags_clear, 0, __pyx_n_s_mpfr_flags_clear, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__277)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_flags_clear, __pyx_t_4) < 0) __PYX_ERR(1, 3369, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3377 + * cmpfr.mpfr_flags_clear(mask) + * + * def mpfr_flags_set(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Set (raise) the group of flags specified by mask. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_413mpfr_flags_set, 0, __pyx_n_s_mpfr_flags_set, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__278)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3377, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_flags_set, __pyx_t_4) < 0) __PYX_ERR(1, 3377, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3385 + * cmpfr.mpfr_flags_set(mask) + * + * def mpfr_flags_test(cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Return the flags specified by mask. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_415mpfr_flags_test, 0, __pyx_n_s_mpfr_flags_test, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__279)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3385, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_flags_test, __pyx_t_4) < 0) __PYX_ERR(1, 3385, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3393 + * return cmpfr.mpfr_flags_test(mask) + * + * def mpfr_flags_save(): # <<<<<<<<<<<<<< + * """ + * Return all the flags. This is equivalent to mpfr_flags_test(MPFR_FLAGS_ALL) + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_417mpfr_flags_save, 0, __pyx_n_s_mpfr_flags_save, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__280)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3393, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_flags_save, __pyx_t_4) < 0) __PYX_ERR(1, 3393, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":3400 + * return cmpfr.mpfr_flags_save() + * + * def mpfr_flags_restore(cmpfr.mpfr_flags_t flags, cmpfr.mpfr_flags_t mask): # <<<<<<<<<<<<<< + * """ + * Set the current flag state from an integer. + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_4mpfr_419mpfr_flags_restore, 0, __pyx_n_s_mpfr_flags_restore, NULL, __pyx_n_s_mpfr, __pyx_d, ((PyObject *)__pyx_codeobj__282)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3400, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_mpfr_flags_restore, __pyx_t_4) < 0) __PYX_ERR(1, 3400, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "mpfr.pyx":1 + * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<< + * # cython: language_level=3, embedsignature=True + * + */ + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /*--- Wrapped vars code ---*/ + + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + if (__pyx_m) { + if (__pyx_d && stringtab_initialized) { + __Pyx_AddTraceback("init mpfr", __pyx_clineno, __pyx_lineno, __pyx_filename); + } + #if !CYTHON_USE_MODULE_STATE + Py_CLEAR(__pyx_m); + #else + Py_DECREF(__pyx_m); + if (pystate_addmodule_run) { + PyObject *tp, *value, *tb; + PyErr_Fetch(&tp, &value, &tb); + PyState_RemoveModule(&__pyx_moduledef); + PyErr_Restore(tp, value, tb); + } + #endif + } else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_ImportError, "init mpfr"); + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + #if CYTHON_PEP489_MULTI_PHASE_INIT + return (__pyx_m != NULL) ? 0 : -1; + #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; + #else + return; + #endif +} +/* #### Code section: cleanup_globals ### */ +/* #### Code section: cleanup_module ### */ +/* #### Code section: main_method ### */ +/* #### Code section: utility_code_pragmas ### */ +#ifdef _MSC_VER +#pragma warning( push ) +/* Warning 4127: conditional expression is constant + * Cython uses constant conditional expressions to allow in inline functions to be optimized at + * compile-time, so this warning is not useful + */ +#pragma warning( disable : 4127 ) +#endif + + + +/* #### Code section: utility_code_def ### */ + +/* --- Runtime support code --- */ +/* Refnanny */ +#if CYTHON_REFNANNY +static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; + void *r = NULL; + m = PyImport_ImportModule(modname); + if (!m) goto end; + p = PyObject_GetAttrString(m, "RefNannyAPI"); + if (!p) goto end; + r = PyLong_AsVoidPtr(p); +end: + Py_XDECREF(p); + Py_XDECREF(m); + return (__Pyx_RefNannyAPIStruct *)r; +} +#endif + +/* PyErrExceptionMatches */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030C00A6 + PyObject *current_exception = tstate->current_exception; + if (unlikely(!current_exception)) return 0; + exc_type = (PyObject*) Py_TYPE(current_exception); + if (exc_type == err) return 1; +#else + exc_type = tstate->curexc_type; + if (exc_type == err) return 1; + if (unlikely(!exc_type)) return 0; +#endif + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(exc_type); + #endif + if (unlikely(PyTuple_Check(err))) { + result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); + } else { + result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(exc_type); + #endif + return result; +} +#endif + +/* PyErrFetchRestore */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject *tmp_value; + assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value))); + if (value) { + #if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb)) + #endif + PyException_SetTraceback(value, tb); + } + tmp_value = tstate->current_exception; + tstate->current_exception = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#endif +} +static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { +#if PY_VERSION_HEX >= 0x030C00A6 + PyObject* exc_value; + exc_value = tstate->current_exception; + tstate->current_exception = 0; + *value = exc_value; + *type = NULL; + *tb = NULL; + if (exc_value) { + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + #if CYTHON_COMPILING_IN_CPYTHON + *tb = ((PyBaseExceptionObject*) exc_value)->traceback; + Py_XINCREF(*tb); + #else + *tb = PyException_GetTraceback(exc_value); + #endif + } +#else + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +#endif +} +#endif + +/* PyObjectGetAttrStr */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro)) + return tp->tp_getattro(obj, attr_name); +#if PY_MAJOR_VERSION < 3 + if (likely(tp->tp_getattr)) + return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +#endif + return PyObject_GetAttr(obj, attr_name); +} +#endif + +/* PyObjectGetAttrStrNoError */ +#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) + __Pyx_PyErr_Clear(); +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { + PyObject *result; +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 + (void) PyObject_GetOptionalAttr(obj, attr_name, &result); + return result; +#else +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 + PyTypeObject* tp = Py_TYPE(obj); + if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { + return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); + } +#endif + result = __Pyx_PyObject_GetAttrStr(obj, attr_name); + if (unlikely(!result)) { + __Pyx_PyObject_GetAttrStr_ClearAttributeError(); + } + return result; +#endif +} + +/* GetBuiltinName */ +static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + if (unlikely(!result) && !PyErr_Occurred()) { + PyErr_Format(PyExc_NameError, +#if PY_MAJOR_VERSION >= 3 + "name '%U' is not defined", name); +#else + "name '%.200s' is not defined", PyString_AS_STRING(name)); +#endif + } + return result; +} + +/* TupleAndListFromArray */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + Py_INCREF(__pyx_empty_tuple); + return __pyx_empty_tuple; + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} +static CYTHON_INLINE PyObject * +__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return PyList_New(0); + } + res = PyList_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n); + return res; +} +#endif + +/* BytesEquals */ +static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else + if (s1 == s2) { + return (equals == Py_EQ); + } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { + const char *ps1, *ps2; + Py_ssize_t length = PyBytes_GET_SIZE(s1); + if (length != PyBytes_GET_SIZE(s2)) + return (equals == Py_NE); + ps1 = PyBytes_AS_STRING(s1); + ps2 = PyBytes_AS_STRING(s2); + if (ps1[0] != ps2[0]) { + return (equals == Py_NE); + } else if (length == 1) { + return (equals == Py_EQ); + } else { + int result; +#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000) + Py_hash_t hash1, hash2; + hash1 = ((PyBytesObject*)s1)->ob_shash; + hash2 = ((PyBytesObject*)s2)->ob_shash; + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + return (equals == Py_NE); + } +#endif + result = memcmp(ps1, ps2, (size_t)length); + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { + return (equals == Py_NE); + } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { + return (equals == Py_NE); + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +#endif +} + +/* UnicodeEquals */ +static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API + return PyObject_RichCompareBool(s1, s2, equals); +#else +#if PY_MAJOR_VERSION < 3 + PyObject* owned_ref = NULL; +#endif + int s1_is_unicode, s2_is_unicode; + if (s1 == s2) { + goto return_eq; + } + s1_is_unicode = PyUnicode_CheckExact(s1); + s2_is_unicode = PyUnicode_CheckExact(s2); +#if PY_MAJOR_VERSION < 3 + if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { + owned_ref = PyUnicode_FromObject(s2); + if (unlikely(!owned_ref)) + return -1; + s2 = owned_ref; + s2_is_unicode = 1; + } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { + owned_ref = PyUnicode_FromObject(s1); + if (unlikely(!owned_ref)) + return -1; + s1 = owned_ref; + s1_is_unicode = 1; + } else if (((!s2_is_unicode) & (!s1_is_unicode))) { + return __Pyx_PyBytes_Equals(s1, s2, equals); + } +#endif + if (s1_is_unicode & s2_is_unicode) { + Py_ssize_t length; + int kind; + void *data1, *data2; + if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) + return -1; + length = __Pyx_PyUnicode_GET_LENGTH(s1); + if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + goto return_ne; + } +#if CYTHON_USE_UNICODE_INTERNALS + { + Py_hash_t hash1, hash2; + #if CYTHON_PEP393_ENABLED + hash1 = ((PyASCIIObject*)s1)->hash; + hash2 = ((PyASCIIObject*)s2)->hash; + #else + hash1 = ((PyUnicodeObject*)s1)->hash; + hash2 = ((PyUnicodeObject*)s2)->hash; + #endif + if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { + goto return_ne; + } + } +#endif + kind = __Pyx_PyUnicode_KIND(s1); + if (kind != __Pyx_PyUnicode_KIND(s2)) { + goto return_ne; + } + data1 = __Pyx_PyUnicode_DATA(s1); + data2 = __Pyx_PyUnicode_DATA(s2); + if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { + goto return_ne; + } else if (length == 1) { + goto return_eq; + } else { + int result = memcmp(data1, data2, (size_t)(length * kind)); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ) ? (result == 0) : (result != 0); + } + } else if ((s1 == Py_None) & s2_is_unicode) { + goto return_ne; + } else if ((s2 == Py_None) & s1_is_unicode) { + goto return_ne; + } else { + int result; + PyObject* py_result = PyObject_RichCompare(s1, s2, equals); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + if (!py_result) + return -1; + result = __Pyx_PyObject_IsTrue(py_result); + Py_DECREF(py_result); + return result; + } +return_eq: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_EQ); +return_ne: + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(owned_ref); + #endif + return (equals == Py_NE); +#endif +} + +/* fastcall */ +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) +{ + Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + for (i = 0; i < n; i++) + { + if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + } + for (i = 0; i < n; i++) + { + int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + if (unlikely(eq != 0)) { + if (unlikely(eq < 0)) return NULL; + return kwvalues[i]; + } + } + return NULL; +} +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { + Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + PyObject *dict; + dict = PyDict_New(); + if (unlikely(!dict)) + return NULL; + for (i=0; i= 0x030C00A6 + PyException_SetTraceback(value, tb); + #elif CYTHON_FAST_THREAD_STATE + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } +#else + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); + Py_INCREF(tb); + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); +#endif + } +bad: + Py_XDECREF(owned_instance); + return; +} +#endif + +/* RaiseDoubleKeywords */ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AsString(kw_name)); + #endif +} + +/* ParseKeywords */ +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject *const *kwvalues, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); + while (1) { + Py_XDECREF(key); key = NULL; + Py_XDECREF(value); value = NULL; + if (kwds_is_tuple) { + Py_ssize_t size; +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(kwds); +#else + size = PyTuple_Size(kwds); + if (size < 0) goto bad; +#endif + if (pos >= size) break; +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); + if (!key) goto bad; +#elif CYTHON_ASSUME_SAFE_MACROS + key = PyTuple_GET_ITEM(kwds, pos); +#else + key = PyTuple_GetItem(kwds, pos); + if (!key) goto bad; +#endif + value = kwvalues[pos]; + pos++; + } + else + { + if (!PyDict_Next(kwds, &pos, &key, &value)) break; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + } + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(value); + Py_DECREF(key); +#endif + key = NULL; + value = NULL; + continue; + } +#if !CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); +#endif + Py_INCREF(value); + name = first_kw_arg; + #if PY_MAJOR_VERSION < 3 + if (likely(PyString_Check(key))) { + while (*name) { + if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) + && _PyString_Eq(**name, key)) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + if ((**argname == key) || ( + (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) + && _PyString_Eq(**argname, key))) { + goto arg_passed_twice; + } + argname++; + } + } + } else + #endif + if (likely(PyUnicode_Check(key))) { + while (*name) { + int cmp = ( + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**name, key) + ); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + values[name-argnames] = value; +#if CYTHON_AVOID_BORROWED_REFS + value = NULL; +#endif + break; + } + name++; + } + if (*name) continue; + else { + PyObject*** argname = argnames; + while (argname != first_kw_arg) { + int cmp = (**argname == key) ? 0 : + #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 + (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : + #endif + PyUnicode_Compare(**argname, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + argname++; + } + } + } else + goto invalid_keyword_type; + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + Py_XDECREF(key); + Py_XDECREF(value); + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%.200s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + #if PY_MAJOR_VERSION < 3 + PyErr_Format(PyExc_TypeError, + "%.200s() got an unexpected keyword argument '%.200s'", + function_name, PyString_AsString(key)); + #else + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + Py_XDECREF(key); + Py_XDECREF(value); + return -1; +} + +/* ArgTypeTest */ +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) +{ + __Pyx_TypeName type_name; + __Pyx_TypeName obj_type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + else if (exact) { + #if PY_MAJOR_VERSION == 2 + if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { + if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } + type_name = __Pyx_PyType_GetName(type); + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME + ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + __Pyx_DECREF_TypeName(type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* PyObjectCall */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = Py_TYPE(func)->tp_call; + if (unlikely(!call)) + return PyObject_Call(func, arg, kw); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = (*call)(func, arg, kw); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyFunctionFastCall */ +#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, + PyObject *globals) { + PyFrameObject *f; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject **fastlocals; + Py_ssize_t i; + PyObject *result; + assert(globals != NULL); + /* XXX Perhaps we should create a specialized + PyFrame_New() that doesn't take locals, but does + take builtins without sanity checking them. + */ + assert(tstate != NULL); + f = PyFrame_New(tstate, co, globals, NULL); + if (f == NULL) { + return NULL; + } + fastlocals = __Pyx_PyFrame_GetLocalsplus(f); + for (i = 0; i < na; i++) { + Py_INCREF(*args); + fastlocals[i] = *args++; + } + result = PyEval_EvalFrameEx(f,0); + ++tstate->recursion_depth; + Py_DECREF(f); + --tstate->recursion_depth; + return result; +} +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { + PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); + PyObject *globals = PyFunction_GET_GLOBALS(func); + PyObject *argdefs = PyFunction_GET_DEFAULTS(func); + PyObject *closure; +#if PY_MAJOR_VERSION >= 3 + PyObject *kwdefs; +#endif + PyObject *kwtuple, **k; + PyObject **d; + Py_ssize_t nd; + Py_ssize_t nk; + PyObject *result; + assert(kwargs == NULL || PyDict_Check(kwargs)); + nk = kwargs ? PyDict_Size(kwargs) : 0; + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { + return NULL; + } + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { + return NULL; + } + #endif + if ( +#if PY_MAJOR_VERSION >= 3 + co->co_kwonlyargcount == 0 && +#endif + likely(kwargs == NULL || nk == 0) && + co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { + if (argdefs == NULL && co->co_argcount == nargs) { + result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); + goto done; + } + else if (nargs == 0 && argdefs != NULL + && co->co_argcount == Py_SIZE(argdefs)) { + /* function called with no arguments, but all parameters have + a default value: use default values as arguments .*/ + args = &PyTuple_GET_ITEM(argdefs, 0); + result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); + goto done; + } + } + if (kwargs != NULL) { + Py_ssize_t pos, i; + kwtuple = PyTuple_New(2 * nk); + if (kwtuple == NULL) { + result = NULL; + goto done; + } + k = &PyTuple_GET_ITEM(kwtuple, 0); + pos = i = 0; + while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { + Py_INCREF(k[i]); + Py_INCREF(k[i+1]); + i += 2; + } + nk = i / 2; + } + else { + kwtuple = NULL; + k = NULL; + } + closure = PyFunction_GET_CLOSURE(func); +#if PY_MAJOR_VERSION >= 3 + kwdefs = PyFunction_GET_KW_DEFAULTS(func); +#endif + if (argdefs != NULL) { + d = &PyTuple_GET_ITEM(argdefs, 0); + nd = Py_SIZE(argdefs); + } + else { + d = NULL; + nd = 0; + } +#if PY_MAJOR_VERSION >= 3 + result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, kwdefs, closure); +#else + result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, + args, (int)nargs, + k, (int)nk, + d, (int)nd, closure); +#endif + Py_XDECREF(kwtuple); +done: + Py_LeaveRecursiveCall(); + return result; +} +#endif + +/* PyObjectCallMethO */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); + self = __Pyx_CyOrPyCFunction_GET_SELF(func); + #if PY_MAJOR_VERSION < 3 + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + #else + if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) + return NULL; + #endif + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +/* PyObjectFastCall */ +#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { + PyObject *argstuple; + PyObject *result = 0; + size_t i; + argstuple = PyTuple_New((Py_ssize_t)nargs); + if (unlikely(!argstuple)) return NULL; + for (i = 0; i < nargs; i++) { + Py_INCREF(args[i]); + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + } + result = __Pyx_PyObject_Call(func, argstuple, kwargs); + bad: + Py_DECREF(argstuple); + return result; +} +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { + Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); +#if CYTHON_COMPILING_IN_CPYTHON + if (nargs == 0 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS)) + return __Pyx_PyObject_CallMethO(func, NULL); + } + else if (nargs == 1 && kwargs == NULL) { + if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O)) + return __Pyx_PyObject_CallMethO(func, args[0]); + } +#endif + #if PY_VERSION_HEX < 0x030800B1 + #if CYTHON_FAST_PYCCALL + if (PyCFunction_Check(func)) { + if (kwargs) { + return _PyCFunction_FastCallDict(func, args, nargs, kwargs); + } else { + return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); + } + } + #if PY_VERSION_HEX >= 0x030700A1 + if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { + return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); + } + #endif + #endif + #if CYTHON_FAST_PYCALL + if (PyFunction_Check(func)) { + return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); + } + #endif + #endif + if (kwargs == NULL) { + #if CYTHON_VECTORCALL + #if PY_VERSION_HEX < 0x03090000 + vectorcallfunc f = _PyVectorcall_Function(func); + #else + vectorcallfunc f = PyVectorcall_Function(func); + #endif + if (f) { + return f(func, args, (size_t)nargs, NULL); + } + #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL + if (__Pyx_CyFunction_CheckExact(func)) { + __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); + if (f) return f(func, args, (size_t)nargs, NULL); + } + #endif + } + if (nargs == 0) { + return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + } + #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API + return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); + #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); + #endif +} + +/* RaiseUnexpectedTypeError */ +static int +__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) +{ + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, + expected, obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return 0; +} + +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C00A6 + local_value = tstate->current_exception; + tstate->current_exception = 0; + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 + if (unlikely(tstate->current_exception)) +#elif CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* SwapException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_value = exc_info->exc_value; + exc_info->exc_value = *value; + if (tmp_value == NULL || tmp_value == Py_None) { + Py_XDECREF(tmp_value); + tmp_value = NULL; + tmp_type = NULL; + tmp_tb = NULL; + } else { + tmp_type = (PyObject*) Py_TYPE(tmp_value); + Py_INCREF(tmp_type); + #if CYTHON_COMPILING_IN_CPYTHON + tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback; + Py_XINCREF(tmp_tb); + #else + tmp_tb = PyException_GetTraceback(tmp_value); + #endif + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = *type; + exc_info->exc_value = *value; + exc_info->exc_traceback = *tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + #endif + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#else +static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); + PyErr_SetExcInfo(*type, *value, *tb); + *type = tmp_type; + *value = tmp_value; + *tb = tmp_tb; +} +#endif + +/* GetTopmostException */ +#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE +static _PyErr_StackItem * +__Pyx_PyErr_GetTopmostException(PyThreadState *tstate) +{ + _PyErr_StackItem *exc_info = tstate->exc_info; + while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) && + exc_info->previous_item != NULL) + { + exc_info = exc_info->previous_item; + } + return exc_info; +} +#endif + +/* SaveResetException */ +#if CYTHON_FAST_THREAD_STATE +static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + PyObject *exc_value = exc_info->exc_value; + if (exc_value == NULL || exc_value == Py_None) { + *value = NULL; + *type = NULL; + *tb = NULL; + } else { + *value = exc_value; + Py_INCREF(*value); + *type = (PyObject*) Py_TYPE(exc_value); + Py_INCREF(*type); + *tb = PyException_GetTraceback(exc_value); + } + #elif CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); + *type = exc_info->exc_type; + *value = exc_info->exc_value; + *tb = exc_info->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); + #endif +} +static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4 + _PyErr_StackItem *exc_info = tstate->exc_info; + PyObject *tmp_value = exc_info->exc_value; + exc_info->exc_value = value; + Py_XDECREF(tmp_value); + Py_XDECREF(type); + Py_XDECREF(tb); + #else + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if CYTHON_USE_EXC_INFO_STACK + _PyErr_StackItem *exc_info = tstate->exc_info; + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = type; + exc_info->exc_value = value; + exc_info->exc_traceback = tb; + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); + #endif +} +#endif + +/* PyDictVersioning */ +#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; +} +static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { + PyObject **dictptr = NULL; + Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; + if (offset) { +#if CYTHON_COMPILING_IN_CPYTHON + dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); +#else + dictptr = _PyObject_GetDictPtr(obj); +#endif + } + return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; +} +static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { + PyObject *dict = Py_TYPE(obj)->tp_dict; + if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) + return 0; + return obj_dict_version == __Pyx_get_object_dict_version(obj); +} +#endif + +/* GetModuleGlobalName */ +#if CYTHON_USE_DICT_VERSIONS +static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) +#else +static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) +#endif +{ + PyObject *result; +#if !CYTHON_AVOID_BORROWED_REFS +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000 + result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } else if (unlikely(PyErr_Occurred())) { + return NULL; + } +#elif CYTHON_COMPILING_IN_LIMITED_API + if (unlikely(!__pyx_m)) { + return NULL; + } + result = PyObject_GetAttr(__pyx_m, name); + if (likely(result)) { + return result; + } +#else + result = PyDict_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } +#endif +#else + result = PyObject_GetItem(__pyx_d, name); + __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) + if (likely(result)) { + return __Pyx_NewRef(result); + } + PyErr_Clear(); +#endif + return __Pyx_GetBuiltinName(name); +} + +/* decode_c_bytes */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes( + const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + if (unlikely((start < 0) | (stop < 0))) { + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (stop > length) + stop = length; + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* WriteUnraisableException */ +static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + __Pyx_PyThreadState_declare +#ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); + else state = (PyGILState_STATE)0; +#endif + CYTHON_UNUSED_VAR(clineno); + CYTHON_UNUSED_VAR(lineno); + CYTHON_UNUSED_VAR(filename); + CYTHON_MAYBE_UNUSED_VAR(nogil); + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); + Py_XINCREF(old_val); + Py_XINCREF(old_tb); + __Pyx_ErrRestore(old_exc, old_val, old_tb); + PyErr_PrintEx(1); + } + #if PY_MAJOR_VERSION < 3 + ctx = PyString_FromString(name); + #else + ctx = PyUnicode_FromString(name); + #endif + __Pyx_ErrRestore(old_exc, old_val, old_tb); + if (!ctx) { + PyErr_WriteUnraisable(Py_None); + } else { + PyErr_WriteUnraisable(ctx); + Py_DECREF(ctx); + } +#ifdef WITH_THREAD + if (nogil) + PyGILState_Release(state); +#endif +} + +/* GetItemInt */ +static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (unlikely(!j)) return NULL; + r = PyObject_GetItem(o, j); + Py_DECREF(j); + return r; +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyList_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { + PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + Py_ssize_t wrapped_i = i; + if (wraparound & unlikely(i < 0)) { + wrapped_i += PyTuple_GET_SIZE(o); + } + if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +#else + return PySequence_GetItem(o, i); +#endif +} +static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) { + PyObject *r = PyList_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } + else if (PyTuple_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); + if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) { + PyObject *r = PyTuple_GET_ITEM(o, n); + Py_INCREF(r); + return r; + } + } else { + PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping; + PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence; + if (mm && mm->mp_subscript) { + PyObject *r, *key = PyInt_FromSsize_t(i); + if (unlikely(!key)) return NULL; + r = mm->mp_subscript(o, key); + Py_DECREF(key); + return r; + } + if (likely(sm && sm->sq_item)) { + if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) { + Py_ssize_t l = sm->sq_length(o); + if (likely(l >= 0)) { + i += l; + } else { + if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; + PyErr_Clear(); + } + } + return sm->sq_item(o, i); + } + } +#else + if (is_list || !PyMapping_Check(o)) { + return PySequence_GetItem(o, i); + } +#endif + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); +} + +/* ExtTypeTest */ +static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + __Pyx_TypeName obj_type_name; + __Pyx_TypeName type_name; + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } + if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + type_name = __Pyx_PyType_GetName(type); + PyErr_Format(PyExc_TypeError, + "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME, + obj_type_name, type_name); + __Pyx_DECREF_TypeName(obj_type_name); + __Pyx_DECREF_TypeName(type_name); + return 0; +} + +/* UnpackUnboundCMethod */ +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), + METH_VARARGS | METH_KEYWORDS, + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + target->method = method; +#if CYTHON_COMPILING_IN_CPYTHON + #if PY_MAJOR_VERSION >= 3 + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + #else + if (likely(!__Pyx_CyOrPyCFunction_Check(method))) + #endif + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); + } +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + target->method = unbound_method; + } + } + return 0; +} + +/* CallUnboundCMethod0 */ +static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { + PyObject *args, *result = NULL; + if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_ASSUME_SAFE_MACROS + args = PyTuple_New(1); + if (unlikely(!args)) goto bad; + Py_INCREF(self); + PyTuple_SET_ITEM(args, 0, self); +#else + args = PyTuple_Pack(1, self); + if (unlikely(!args)) goto bad; +#endif + result = __Pyx_PyObject_Call(cfunc->method, args, NULL); + Py_DECREF(args); +bad: + return result; +} + +/* FixUpExtensionType */ +#if CYTHON_USE_TYPE_SPECS +static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) { +#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + CYTHON_UNUSED_VAR(spec); + CYTHON_UNUSED_VAR(type); +#else + const PyType_Slot *slot = spec->slots; + while (slot && slot->slot && slot->slot != Py_tp_members) + slot++; + if (slot && slot->slot == Py_tp_members) { + int changed = 0; +#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON) + const +#endif + PyMemberDef *memb = (PyMemberDef*) slot->pfunc; + while (memb && memb->name) { + if (memb->name[0] == '_' && memb->name[1] == '_') { +#if PY_VERSION_HEX < 0x030900b1 + if (strcmp(memb->name, "__weaklistoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_weaklistoffset = memb->offset; + changed = 1; + } + else if (strcmp(memb->name, "__dictoffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); + type->tp_dictoffset = memb->offset; + changed = 1; + } +#if CYTHON_METH_FASTCALL + else if (strcmp(memb->name, "__vectorcalloffset__") == 0) { + assert(memb->type == T_PYSSIZET); + assert(memb->flags == READONLY); +#if PY_VERSION_HEX >= 0x030800b4 + type->tp_vectorcall_offset = memb->offset; +#else + type->tp_print = (printfunc) memb->offset; +#endif + changed = 1; + } +#endif +#else + if ((0)); +#endif +#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON + else if (strcmp(memb->name, "__module__") == 0) { + PyObject *descr; + assert(memb->type == T_OBJECT); + assert(memb->flags == 0 || memb->flags == READONLY); + descr = PyDescr_NewMember(type, memb); + if (unlikely(!descr)) + return -1; + if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) { + Py_DECREF(descr); + return -1; + } + Py_DECREF(descr); + changed = 1; + } +#endif + } + memb++; + } + if (changed) + PyType_Modified(type); + } +#endif + return 0; +} +#endif + +/* PyObjectCallNoArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { + PyObject *arg[2] = {NULL, NULL}; + return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + +/* PyObjectGetMethod */ +static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { + PyObject *attr; +#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP + __Pyx_TypeName type_name; + PyTypeObject *tp = Py_TYPE(obj); + PyObject *descr; + descrgetfunc f = NULL; + PyObject **dictptr, *dict; + int meth_found = 0; + assert (*method == NULL); + if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; + } + if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { + return 0; + } + descr = _PyType_Lookup(tp, name); + if (likely(descr != NULL)) { + Py_INCREF(descr); +#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR + if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) +#elif PY_MAJOR_VERSION >= 3 + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type))) + #endif +#else + #ifdef __Pyx_CyFunction_USED + if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) + #else + if (likely(PyFunction_Check(descr))) + #endif +#endif + { + meth_found = 1; + } else { + f = Py_TYPE(descr)->tp_descr_get; + if (f != NULL && PyDescr_IsData(descr)) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + } + } + dictptr = _PyObject_GetDictPtr(obj); + if (dictptr != NULL && (dict = *dictptr) != NULL) { + Py_INCREF(dict); + attr = __Pyx_PyDict_GetItemStr(dict, name); + if (attr != NULL) { + Py_INCREF(attr); + Py_DECREF(dict); + Py_XDECREF(descr); + goto try_unpack; + } + Py_DECREF(dict); + } + if (meth_found) { + *method = descr; + return 1; + } + if (f != NULL) { + attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); + Py_DECREF(descr); + goto try_unpack; + } + if (likely(descr != NULL)) { + *method = descr; + return 0; + } + type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return 0; +#else + attr = __Pyx_PyObject_GetAttrStr(obj, name); + goto try_unpack; +#endif +try_unpack: +#if CYTHON_UNPACK_METHODS + if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { + PyObject *function = PyMethod_GET_FUNCTION(attr); + Py_INCREF(function); + Py_DECREF(attr); + *method = function; + return 1; + } +#endif + *method = attr; + return 0; +} + +/* PyObjectCallMethod0 */ +static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) { + PyObject *method = NULL, *result = NULL; + int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); + if (likely(is_method)) { + result = __Pyx_PyObject_CallOneArg(method, obj); + Py_DECREF(method); + return result; + } + if (unlikely(!method)) goto bad; + result = __Pyx_PyObject_CallNoArg(method); + Py_DECREF(method); +bad: + return result; +} + +/* ValidateBasesTuple */ +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS +static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) { + Py_ssize_t i, n; +#if CYTHON_ASSUME_SAFE_MACROS + n = PyTuple_GET_SIZE(bases); +#else + n = PyTuple_Size(bases); + if (n < 0) return -1; +#endif + for (i = 1; i < n; i++) + { +#if CYTHON_AVOID_BORROWED_REFS + PyObject *b0 = PySequence_GetItem(bases, i); + if (!b0) return -1; +#elif CYTHON_ASSUME_SAFE_MACROS + PyObject *b0 = PyTuple_GET_ITEM(bases, i); +#else + PyObject *b0 = PyTuple_GetItem(bases, i); + if (!b0) return -1; +#endif + PyTypeObject *b; +#if PY_MAJOR_VERSION < 3 + if (PyClass_Check(b0)) + { + PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class", + PyString_AS_STRING(((PyClassObject*)b0)->cl_name)); +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } +#endif + b = (PyTypeObject*) b0; + if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE)) + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name); + __Pyx_DECREF_TypeName(b_name); +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } + if (dictoffset == 0) + { + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + return -1; + } + } +#if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(b0); +#endif + } + return 0; +} +#endif + +/* PyType_Ready */ +static int __Pyx_PyType_Ready(PyTypeObject *t) { +#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION) + (void)__Pyx_PyObject_CallMethod0; +#if CYTHON_USE_TYPE_SPECS + (void)__Pyx_validate_bases_tuple; +#endif + return PyType_Ready(t); +#else + int r; + PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*); + if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1)) + return -1; +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + { + int gc_was_enabled; + #if PY_VERSION_HEX >= 0x030A00b1 + gc_was_enabled = PyGC_Disable(); + (void)__Pyx_PyObject_CallMethod0; + #else + PyObject *ret, *py_status; + PyObject *gc = NULL; + #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) + gc = PyImport_GetModule(__pyx_kp_u_gc); + #endif + if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc); + if (unlikely(!gc)) return -1; + py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled); + if (unlikely(!py_status)) { + Py_DECREF(gc); + return -1; + } + gc_was_enabled = __Pyx_PyObject_IsTrue(py_status); + Py_DECREF(py_status); + if (gc_was_enabled > 0) { + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable); + if (unlikely(!ret)) { + Py_DECREF(gc); + return -1; + } + Py_DECREF(ret); + } else if (unlikely(gc_was_enabled == -1)) { + Py_DECREF(gc); + return -1; + } + #endif + t->tp_flags |= Py_TPFLAGS_HEAPTYPE; +#if PY_VERSION_HEX >= 0x030A0000 + t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE; +#endif +#else + (void)__Pyx_PyObject_CallMethod0; +#endif + r = PyType_Ready(t); +#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION) + t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE; + #if PY_VERSION_HEX >= 0x030A00b1 + if (gc_was_enabled) + PyGC_Enable(); + #else + if (gc_was_enabled) { + PyObject *tp, *v, *tb; + PyErr_Fetch(&tp, &v, &tb); + ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable); + if (likely(ret || r == -1)) { + Py_XDECREF(ret); + PyErr_Restore(tp, v, tb); + } else { + Py_XDECREF(tp); + Py_XDECREF(v); + Py_XDECREF(tb); + r = -1; + } + } + Py_DECREF(gc); + #endif + } +#endif + return r; +#endif +} + +/* PyObject_GenericGetAttrNoDict */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { + __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp); + PyErr_Format(PyExc_AttributeError, +#if PY_MAJOR_VERSION >= 3 + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'", + type_name, attr_name); +#else + "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'", + type_name, PyString_AS_STRING(attr_name)); +#endif + __Pyx_DECREF_TypeName(type_name); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { + PyObject *descr; + PyTypeObject *tp = Py_TYPE(obj); + if (unlikely(!PyString_Check(attr_name))) { + return PyObject_GenericGetAttr(obj, attr_name); + } + assert(!tp->tp_dictoffset); + descr = _PyType_Lookup(tp, attr_name); + if (unlikely(!descr)) { + return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); + } + Py_INCREF(descr); + #if PY_MAJOR_VERSION < 3 + if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) + #endif + { + descrgetfunc f = Py_TYPE(descr)->tp_descr_get; + if (unlikely(f)) { + PyObject *res = f(descr, obj, (PyObject *)tp); + Py_DECREF(descr); + return res; + } + } + return descr; +} +#endif + +/* PyObject_GenericGetAttr */ +#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 +static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { + if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { + return PyObject_GenericGetAttr(obj, attr_name); + } + return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); +} +#endif + +/* SetupReduce */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { + int ret; + PyObject *name_attr; + name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name); + if (likely(name_attr)) { + ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); + } else { + ret = -1; + } + if (unlikely(ret < 0)) { + PyErr_Clear(); + ret = 0; + } + Py_XDECREF(name_attr); + return ret; +} +static int __Pyx_setup_reduce(PyObject* type_obj) { + int ret = 0; + PyObject *object_reduce = NULL; + PyObject *object_getstate = NULL; + PyObject *object_reduce_ex = NULL; + PyObject *reduce = NULL; + PyObject *reduce_ex = NULL; + PyObject *reduce_cython = NULL; + PyObject *setstate = NULL; + PyObject *setstate_cython = NULL; + PyObject *getstate = NULL; +#if CYTHON_USE_PYTYPE_LOOKUP + getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate); +#else + getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate); + if (!getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } +#endif + if (getstate) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate); +#else + object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate); + if (!object_getstate && PyErr_Occurred()) { + goto __PYX_BAD; + } +#endif + if (object_getstate != getstate) { + goto __PYX_GOOD; + } + } +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#else + object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD; +#endif + reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD; + if (reduce_ex == object_reduce_ex) { +#if CYTHON_USE_PYTYPE_LOOKUP + object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#else + object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD; +#endif + reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD; + if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { + reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython); + if (likely(reduce_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (reduce == object_reduce || PyErr_Occurred()) { + goto __PYX_BAD; + } + setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate); + if (!setstate) PyErr_Clear(); + if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { + setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython); + if (likely(setstate_cython)) { + ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD; + } else if (!setstate || PyErr_Occurred()) { + goto __PYX_BAD; + } + } + PyType_Modified((PyTypeObject*)type_obj); + } + } + goto __PYX_GOOD; +__PYX_BAD: + if (!PyErr_Occurred()) { + __Pyx_TypeName type_obj_name = + __Pyx_PyType_GetName((PyTypeObject*)type_obj); + PyErr_Format(PyExc_RuntimeError, + "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name); + __Pyx_DECREF_TypeName(type_obj_name); + } + ret = -1; +__PYX_GOOD: +#if !CYTHON_USE_PYTYPE_LOOKUP + Py_XDECREF(object_reduce); + Py_XDECREF(object_reduce_ex); + Py_XDECREF(object_getstate); + Py_XDECREF(getstate); +#endif + Py_XDECREF(reduce); + Py_XDECREF(reduce_ex); + Py_XDECREF(reduce_cython); + Py_XDECREF(setstate); + Py_XDECREF(setstate_cython); + return ret; +} +#endif + +/* Import */ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *module = 0; + PyObject *empty_dict = 0; + PyObject *empty_list = 0; + #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (unlikely(!py_import)) + goto bad; + if (!from_list) { + empty_list = PyList_New(0); + if (unlikely(!empty_list)) + goto bad; + from_list = empty_list; + } + #endif + empty_dict = PyDict_New(); + if (unlikely(!empty_dict)) + goto bad; + { + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.') != NULL) { + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, 1); + if (unlikely(!module)) { + if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError))) + goto bad; + PyErr_Clear(); + } + } + level = 0; + } + #endif + if (!module) { + #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (unlikely(!py_level)) + goto bad; + module = PyObject_CallFunctionObjArgs(py_import, + name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL); + Py_DECREF(py_level); + #else + module = PyImport_ImportModuleLevelObject( + name, __pyx_d, empty_dict, from_list, level); + #endif + } + } +bad: + Py_XDECREF(empty_dict); + Py_XDECREF(empty_list); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + return module; +} + +/* ImportDottedModule */ +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) { + PyObject *partial_name = NULL, *slice = NULL, *sep = NULL; + if (unlikely(PyErr_Occurred())) { + PyErr_Clear(); + } + if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) { + partial_name = name; + } else { + slice = PySequence_GetSlice(parts_tuple, 0, count); + if (unlikely(!slice)) + goto bad; + sep = PyUnicode_FromStringAndSize(".", 1); + if (unlikely(!sep)) + goto bad; + partial_name = PyUnicode_Join(sep, slice); + } + PyErr_Format( +#if PY_MAJOR_VERSION < 3 + PyExc_ImportError, + "No module named '%s'", PyString_AS_STRING(partial_name)); +#else +#if PY_VERSION_HEX >= 0x030600B1 + PyExc_ModuleNotFoundError, +#else + PyExc_ImportError, +#endif + "No module named '%U'", partial_name); +#endif +bad: + Py_XDECREF(sep); + Py_XDECREF(slice); + Py_XDECREF(partial_name); + return NULL; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) { + PyObject *imported_module; +#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) + PyObject *modules = PyImport_GetModuleDict(); + if (unlikely(!modules)) + return NULL; + imported_module = __Pyx_PyDict_GetItemStr(modules, name); + Py_XINCREF(imported_module); +#else + imported_module = PyImport_GetModule(name); +#endif + return imported_module; +} +#endif +#if PY_MAJOR_VERSION >= 3 +static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) { + Py_ssize_t i, nparts; + nparts = PyTuple_GET_SIZE(parts_tuple); + for (i=1; i < nparts && module; i++) { + PyObject *part, *submodule; +#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + part = PyTuple_GET_ITEM(parts_tuple, i); +#else + part = PySequence_ITEM(parts_tuple, i); +#endif + submodule = __Pyx_PyObject_GetAttrStrNoError(module, part); +#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(part); +#endif + Py_DECREF(module); + module = submodule; + } + if (unlikely(!module)) { + return __Pyx__ImportDottedModule_Error(name, parts_tuple, i); + } + return module; +} +#endif +static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if PY_MAJOR_VERSION < 3 + PyObject *module, *from_list, *star = __pyx_n_s__12; + CYTHON_UNUSED_VAR(parts_tuple); + from_list = PyList_New(1); + if (unlikely(!from_list)) + return NULL; + Py_INCREF(star); + PyList_SET_ITEM(from_list, 0, star); + module = __Pyx_Import(name, from_list, 0); + Py_DECREF(from_list); + return module; +#else + PyObject *imported_module; + PyObject *module = __Pyx_Import(name, NULL, 0); + if (!parts_tuple || unlikely(!module)) + return module; + imported_module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(imported_module)) { + Py_DECREF(module); + return imported_module; + } + PyErr_Clear(); + return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple); +#endif +} +static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1 + PyObject *module = __Pyx__ImportDottedModule_Lookup(name); + if (likely(module)) { + PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec); + if (likely(spec)) { + PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing); + if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) { + Py_DECREF(spec); + spec = NULL; + } + Py_XDECREF(unsafe); + } + if (likely(!spec)) { + PyErr_Clear(); + return module; + } + Py_DECREF(spec); + Py_DECREF(module); + } else if (PyErr_Occurred()) { + PyErr_Clear(); + } +#endif + return __Pyx__ImportDottedModule(name, parts_tuple); +} + +/* FetchSharedCythonModule */ +static PyObject *__Pyx_FetchSharedCythonABIModule(void) { + return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME); +} + +/* FetchCommonType */ +static int __Pyx_VerifyCachedType(PyObject *cached_type, + const char *name, + Py_ssize_t basicsize, + Py_ssize_t expected_basicsize) { + if (!PyType_Check(cached_type)) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s is not a type object", name); + return -1; + } + if (basicsize != expected_basicsize) { + PyErr_Format(PyExc_TypeError, + "Shared Cython type %.200s has the wrong size, try recompiling", + name); + return -1; + } + return 0; +} +#if !CYTHON_USE_TYPE_SPECS +static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { + PyObject* abi_module; + const char* object_name; + PyTypeObject *cached_type = NULL; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + object_name = strrchr(type->tp_name, '.'); + object_name = object_name ? object_name+1 : type->tp_name; + cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + if (__Pyx_VerifyCachedType( + (PyObject *)cached_type, + object_name, + cached_type->tp_basicsize, + type->tp_basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + if (PyType_Ready(type) < 0) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0) + goto bad; + Py_INCREF(type); + cached_type = type; +done: + Py_DECREF(abi_module); + return cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#else +static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) { + PyObject *abi_module, *cached_type = NULL; + const char* object_name = strrchr(spec->name, '.'); + object_name = object_name ? object_name+1 : spec->name; + abi_module = __Pyx_FetchSharedCythonABIModule(); + if (!abi_module) return NULL; + cached_type = PyObject_GetAttrString(abi_module, object_name); + if (cached_type) { + Py_ssize_t basicsize; +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *py_basicsize; + py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__"); + if (unlikely(!py_basicsize)) goto bad; + basicsize = PyLong_AsSsize_t(py_basicsize); + Py_DECREF(py_basicsize); + py_basicsize = 0; + if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad; +#else + basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1; +#endif + if (__Pyx_VerifyCachedType( + cached_type, + object_name, + basicsize, + spec->basicsize) < 0) { + goto bad; + } + goto done; + } + if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; + PyErr_Clear(); + CYTHON_UNUSED_VAR(module); + cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases); + if (unlikely(!cached_type)) goto bad; + if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad; + if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad; +done: + Py_DECREF(abi_module); + assert(cached_type == NULL || PyType_Check(cached_type)); + return (PyTypeObject *) cached_type; +bad: + Py_XDECREF(cached_type); + cached_type = NULL; + goto done; +} +#endif + +/* PyVectorcallFastCallDict */ +#if CYTHON_METH_FASTCALL +static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + PyObject *res = NULL; + PyObject *kwnames; + PyObject **newargs; + PyObject **kwvalues; + Py_ssize_t i, pos; + size_t j; + PyObject *key, *value; + unsigned long keys_are_strings; + Py_ssize_t nkw = PyDict_GET_SIZE(kw); + newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0])); + if (unlikely(newargs == NULL)) { + PyErr_NoMemory(); + return NULL; + } + for (j = 0; j < nargs; j++) newargs[j] = args[j]; + kwnames = PyTuple_New(nkw); + if (unlikely(kwnames == NULL)) { + PyMem_Free(newargs); + return NULL; + } + kwvalues = newargs + nargs; + pos = i = 0; + keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS; + while (PyDict_Next(kw, &pos, &key, &value)) { + keys_are_strings &= Py_TYPE(key)->tp_flags; + Py_INCREF(key); + Py_INCREF(value); + PyTuple_SET_ITEM(kwnames, i, key); + kwvalues[i] = value; + i++; + } + if (unlikely(!keys_are_strings)) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + goto cleanup; + } + res = vc(func, newargs, nargs, kwnames); +cleanup: + Py_DECREF(kwnames); + for (i = 0; i < nkw; i++) + Py_DECREF(kwvalues[i]); + PyMem_Free(newargs); + return res; +} +static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw) +{ + if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) { + return vc(func, args, nargs, NULL); + } + return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw); +} +#endif + +/* CythonFunctionShared */ +#if CYTHON_COMPILING_IN_LIMITED_API +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + if (__Pyx_CyFunction_Check(func)) { + return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc; + } else if (PyCFunction_Check(func)) { + return PyCFunction_GetFunction(func) == (PyCFunction) cfunc; + } + return 0; +} +#else +static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) { + return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc; +} +#endif +static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) { +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + __Pyx_Py_XDECREF_SET( + __Pyx_CyFunction_GetClassObj(f), + ((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#else + __Pyx_Py_XDECREF_SET( + ((PyCMethodObject *) (f))->mm_class, + (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL)); +#endif +} +static PyObject * +__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) +{ + CYTHON_UNUSED_VAR(closure); + if (unlikely(op->func_doc == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_doc = PyObject_GetAttrString(op->func, "__doc__"); + if (unlikely(!op->func_doc)) return NULL; +#else + if (((PyCFunctionObject*)op)->m_ml->ml_doc) { +#if PY_MAJOR_VERSION >= 3 + op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#else + op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc); +#endif + if (unlikely(op->func_doc == NULL)) + return NULL; + } else { + Py_INCREF(Py_None); + return Py_None; + } +#endif + } + Py_INCREF(op->func_doc); + return op->func_doc; +} +static int +__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (value == NULL) { + value = Py_None; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_doc, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_name == NULL)) { +#if CYTHON_COMPILING_IN_LIMITED_API + op->func_name = PyObject_GetAttrString(op->func, "__name__"); +#elif PY_MAJOR_VERSION >= 3 + op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#else + op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name); +#endif + if (unlikely(op->func_name == NULL)) + return NULL; + } + Py_INCREF(op->func_name); + return op->func_name; +} +static int +__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__name__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_name, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_qualname); + return op->func_qualname; +} +static int +__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); +#if PY_MAJOR_VERSION >= 3 + if (unlikely(value == NULL || !PyUnicode_Check(value))) +#else + if (unlikely(value == NULL || !PyString_Check(value))) +#endif + { + PyErr_SetString(PyExc_TypeError, + "__qualname__ must be set to a string object"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_qualname, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(op->func_dict == NULL)) { + op->func_dict = PyDict_New(); + if (unlikely(op->func_dict == NULL)) + return NULL; + } + Py_INCREF(op->func_dict); + return op->func_dict; +} +static int +__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context) +{ + CYTHON_UNUSED_VAR(context); + if (unlikely(value == NULL)) { + PyErr_SetString(PyExc_TypeError, + "function's dictionary may not be deleted"); + return -1; + } + if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "setting function's dictionary to a non-dict"); + return -1; + } + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->func_dict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(context); + Py_INCREF(op->func_globals); + return op->func_globals; +} +static PyObject * +__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context) +{ + CYTHON_UNUSED_VAR(op); + CYTHON_UNUSED_VAR(context); + Py_INCREF(Py_None); + return Py_None; +} +static PyObject * +__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context) +{ + PyObject* result = (op->func_code) ? op->func_code : Py_None; + CYTHON_UNUSED_VAR(context); + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { + int result = 0; + PyObject *res = op->defaults_getter((PyObject *) op); + if (unlikely(!res)) + return -1; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + op->defaults_tuple = PyTuple_GET_ITEM(res, 0); + Py_INCREF(op->defaults_tuple); + op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); + Py_INCREF(op->defaults_kwdict); + #else + op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0); + if (unlikely(!op->defaults_tuple)) result = -1; + else { + op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1); + if (unlikely(!op->defaults_kwdict)) result = -1; + } + #endif + Py_DECREF(res); + return result; +} +static int +__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyTuple_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__defaults__ must be set to a tuple object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_tuple, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_tuple; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_tuple; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value) { + value = Py_None; + } else if (unlikely(value != Py_None && !PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__kwdefaults__ must be set to a dict object"); + return -1; + } + PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not " + "currently affect the values used in function calls", 1); + Py_INCREF(value); + __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->defaults_kwdict; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + if (op->defaults_getter) { + if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL; + result = op->defaults_kwdict; + } else { + result = Py_None; + } + } + Py_INCREF(result); + return result; +} +static int +__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + if (!value || value == Py_None) { + value = NULL; + } else if (unlikely(!PyDict_Check(value))) { + PyErr_SetString(PyExc_TypeError, + "__annotations__ must be set to a dict object"); + return -1; + } + Py_XINCREF(value); + __Pyx_Py_XDECREF_SET(op->func_annotations, value); + return 0; +} +static PyObject * +__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) { + PyObject* result = op->func_annotations; + CYTHON_UNUSED_VAR(context); + if (unlikely(!result)) { + result = PyDict_New(); + if (unlikely(!result)) return NULL; + op->func_annotations = result; + } + Py_INCREF(result); + return result; +} +static PyObject * +__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) { + int is_coroutine; + CYTHON_UNUSED_VAR(context); + if (op->func_is_coroutine) { + return __Pyx_NewRef(op->func_is_coroutine); + } + is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE; +#if PY_VERSION_HEX >= 0x03050000 + if (is_coroutine) { + PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine; + fromlist = PyList_New(1); + if (unlikely(!fromlist)) return NULL; + Py_INCREF(marker); +#if CYTHON_ASSUME_SAFE_MACROS + PyList_SET_ITEM(fromlist, 0, marker); +#else + if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) { + Py_DECREF(marker); + Py_DECREF(fromlist); + return NULL; + } +#endif + module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0); + Py_DECREF(fromlist); + if (unlikely(!module)) goto ignore; + op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker); + Py_DECREF(module); + if (likely(op->func_is_coroutine)) { + return __Pyx_NewRef(op->func_is_coroutine); + } +ignore: + PyErr_Clear(); + } +#endif + op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine); + return __Pyx_NewRef(op->func_is_coroutine); +} +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject * +__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_GetAttrString(op->func, "__module__"); +} +static int +__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) { + CYTHON_UNUSED_VAR(context); + return PyObject_SetAttrString(op->func, "__module__", value); +} +#endif +static PyGetSetDef __pyx_CyFunction_getsets[] = { + {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, + {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, + {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, + {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, + {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, + {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, + {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, + {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, + {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, + {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, + {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0}, +#if CYTHON_COMPILING_IN_LIMITED_API + {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0}, +#endif + {0, 0, 0, 0, 0} +}; +static PyMemberDef __pyx_CyFunction_members[] = { +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0}, +#endif +#if CYTHON_USE_TYPE_SPECS + {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0}, +#if CYTHON_METH_FASTCALL +#if CYTHON_BACKPORT_VECTORCALL + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0}, +#else +#if !CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0}, +#endif +#endif +#endif +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0}, +#else + {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0}, +#endif +#endif + {0, 0, 0, 0, 0} +}; +static PyObject * +__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args) +{ + CYTHON_UNUSED_VAR(args); +#if PY_MAJOR_VERSION >= 3 + Py_INCREF(m->func_qualname); + return m->func_qualname; +#else + return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name); +#endif +} +static PyMethodDef __pyx_CyFunction_methods[] = { + {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, + {0, 0, 0, 0} +}; +#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) +#else +#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist) +#endif +static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { +#if !CYTHON_COMPILING_IN_LIMITED_API + PyCFunctionObject *cf = (PyCFunctionObject*) op; +#endif + if (unlikely(op == NULL)) + return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API + op->func = PyCFunction_NewEx(ml, (PyObject*)op, module); + if (unlikely(!op->func)) return NULL; +#endif + op->flags = flags; + __Pyx_CyFunction_weakreflist(op) = NULL; +#if !CYTHON_COMPILING_IN_LIMITED_API + cf->m_ml = ml; + cf->m_self = (PyObject *) op; +#endif + Py_XINCREF(closure); + op->func_closure = closure; +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_XINCREF(module); + cf->m_module = module; +#endif + op->func_dict = NULL; + op->func_name = NULL; + Py_INCREF(qualname); + op->func_qualname = qualname; + op->func_doc = NULL; +#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API + op->func_classobj = NULL; +#else + ((PyCMethodObject*)op)->mm_class = NULL; +#endif + op->func_globals = globals; + Py_INCREF(op->func_globals); + Py_XINCREF(code); + op->func_code = code; + op->defaults_pyobjects = 0; + op->defaults_size = 0; + op->defaults = NULL; + op->defaults_tuple = NULL; + op->defaults_kwdict = NULL; + op->defaults_getter = NULL; + op->func_annotations = NULL; + op->func_is_coroutine = NULL; +#if CYTHON_METH_FASTCALL + switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) { + case METH_NOARGS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS; + break; + case METH_O: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O; + break; + case METH_METHOD | METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD; + break; + case METH_FASTCALL | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS; + break; + case METH_VARARGS | METH_KEYWORDS: + __Pyx_CyFunction_func_vectorcall(op) = NULL; + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + Py_DECREF(op); + return NULL; + } +#endif + return (PyObject *) op; +} +static int +__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) +{ + Py_CLEAR(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_CLEAR(m->func); +#else + Py_CLEAR(((PyCFunctionObject*)m)->m_module); +#endif + Py_CLEAR(m->func_dict); + Py_CLEAR(m->func_name); + Py_CLEAR(m->func_qualname); + Py_CLEAR(m->func_doc); + Py_CLEAR(m->func_globals); + Py_CLEAR(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API +#if PY_VERSION_HEX < 0x030900B1 + Py_CLEAR(__Pyx_CyFunction_GetClassObj(m)); +#else + { + PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class; + ((PyCMethodObject *) (m))->mm_class = NULL; + Py_XDECREF(cls); + } +#endif +#endif + Py_CLEAR(m->defaults_tuple); + Py_CLEAR(m->defaults_kwdict); + Py_CLEAR(m->func_annotations); + Py_CLEAR(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_XDECREF(pydefaults[i]); + PyObject_Free(m->defaults); + m->defaults = NULL; + } + return 0; +} +static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + if (__Pyx_CyFunction_weakreflist(m) != NULL) + PyObject_ClearWeakRefs((PyObject *) m); + __Pyx_CyFunction_clear(m); + __Pyx_PyHeapTypeObject_GC_Del(m); +} +static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) +{ + PyObject_GC_UnTrack(m); + __Pyx__CyFunction_dealloc(m); +} +static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) +{ + Py_VISIT(m->func_closure); +#if CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(m->func); +#else + Py_VISIT(((PyCFunctionObject*)m)->m_module); +#endif + Py_VISIT(m->func_dict); + Py_VISIT(m->func_name); + Py_VISIT(m->func_qualname); + Py_VISIT(m->func_doc); + Py_VISIT(m->func_globals); + Py_VISIT(m->func_code); +#if !CYTHON_COMPILING_IN_LIMITED_API + Py_VISIT(__Pyx_CyFunction_GetClassObj(m)); +#endif + Py_VISIT(m->defaults_tuple); + Py_VISIT(m->defaults_kwdict); + Py_VISIT(m->func_is_coroutine); + if (m->defaults) { + PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); + int i; + for (i = 0; i < m->defaults_pyobjects; i++) + Py_VISIT(pydefaults[i]); + } + return 0; +} +static PyObject* +__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) +{ +#if PY_MAJOR_VERSION >= 3 + return PyUnicode_FromFormat("", + op->func_qualname, (void *)op); +#else + return PyString_FromFormat("", + PyString_AsString(op->func_qualname), (void *)op); +#endif +} +static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { +#if CYTHON_COMPILING_IN_LIMITED_API + PyObject *f = ((__pyx_CyFunctionObject*)func)->func; + PyObject *py_name = NULL; + PyCFunction meth; + int flags; + meth = PyCFunction_GetFunction(f); + if (unlikely(!meth)) return NULL; + flags = PyCFunction_GetFlags(f); + if (unlikely(flags < 0)) return NULL; +#else + PyCFunctionObject* f = (PyCFunctionObject*)func; + PyCFunction meth = f->m_ml->ml_meth; + int flags = f->m_ml->ml_flags; +#endif + Py_ssize_t size; + switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { + case METH_VARARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) + return (*meth)(self, arg); + break; + case METH_VARARGS | METH_KEYWORDS: + return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); + case METH_NOARGS: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 0)) + return (*meth)(self, NULL); +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + case METH_O: + if (likely(kw == NULL || PyDict_Size(kw) == 0)) { +#if CYTHON_ASSUME_SAFE_MACROS + size = PyTuple_GET_SIZE(arg); +#else + size = PyTuple_Size(arg); + if (unlikely(size < 0)) return NULL; +#endif + if (likely(size == 1)) { + PyObject *result, *arg0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + arg0 = PyTuple_GET_ITEM(arg, 0); + #else + arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; + #endif + result = (*meth)(self, arg0); + #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) + Py_DECREF(arg0); + #endif + return result; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, + "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + py_name, size); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + f->m_ml->ml_name, size); +#endif + return NULL; + } + break; + default: + PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction"); + return NULL; + } +#if CYTHON_COMPILING_IN_LIMITED_API + py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL); + if (!py_name) return NULL; + PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments", + py_name); + Py_DECREF(py_name); +#else + PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", + f->m_ml->ml_name); +#endif + return NULL; +} +static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *self, *result; +#if CYTHON_COMPILING_IN_LIMITED_API + self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func); + if (unlikely(!self) && PyErr_Occurred()) return NULL; +#else + self = ((PyCFunctionObject*)func)->m_self; +#endif + result = __Pyx_CyFunction_CallMethod(func, self, arg, kw); + return result; +} +static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { + PyObject *result; + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; +#if CYTHON_METH_FASTCALL + __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc); + if (vc) { +#if CYTHON_ASSUME_SAFE_MACROS + return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw); +#else + (void) &__Pyx_PyVectorcall_FastCallDict; + return PyVectorcall_Call(func, args, kw); +#endif + } +#endif + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + Py_ssize_t argc; + PyObject *new_args; + PyObject *self; +#if CYTHON_ASSUME_SAFE_MACROS + argc = PyTuple_GET_SIZE(args); +#else + argc = PyTuple_Size(args); + if (unlikely(!argc) < 0) return NULL; +#endif + new_args = PyTuple_GetSlice(args, 1, argc); + if (unlikely(!new_args)) + return NULL; + self = PyTuple_GetItem(args, 0); + if (unlikely(!self)) { + Py_DECREF(new_args); +#if PY_MAJOR_VERSION > 2 + PyErr_Format(PyExc_TypeError, + "unbound method %.200S() needs an argument", + cyfunc->func_qualname); +#else + PyErr_SetString(PyExc_TypeError, + "unbound method needs an argument"); +#endif + return NULL; + } + result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); + Py_DECREF(new_args); + } else { + result = __Pyx_CyFunction_Call(func, args, kw); + } + return result; +} +#if CYTHON_METH_FASTCALL +static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames) +{ + int ret = 0; + if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { + if (unlikely(nargs < 1)) { + PyErr_Format(PyExc_TypeError, "%.200s() needs an argument", + ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + ret = 1; + } + if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name); + return -1; + } + return ret; +} +static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 0)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, NULL); +} +static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + if (unlikely(nargs != 1)) { + PyErr_Format(PyExc_TypeError, + "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", + def->ml_name, nargs); + return NULL; + } + return def->ml_meth(self, args[0]); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); +} +static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) +{ + __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func; + PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml; + PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc); +#if CYTHON_BACKPORT_VECTORCALL + Py_ssize_t nargs = (Py_ssize_t)nargsf; +#else + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); +#endif + PyObject *self; + switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) { + case 1: + self = args[0]; + args += 1; + nargs -= 1; + break; + case 0: + self = ((PyCFunctionObject*)cyfunc)->m_self; + break; + default: + return NULL; + } + return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames); +} +#endif +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_CyFunctionType_slots[] = { + {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc}, + {Py_tp_repr, (void *)__Pyx_CyFunction_repr}, + {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod}, + {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse}, + {Py_tp_clear, (void *)__Pyx_CyFunction_clear}, + {Py_tp_methods, (void *)__pyx_CyFunction_methods}, + {Py_tp_members, (void *)__pyx_CyFunction_members}, + {Py_tp_getset, (void *)__pyx_CyFunction_getsets}, + {Py_tp_descr_get, (void *)__Pyx_PyMethod_New}, + {0, 0}, +}; +static PyType_Spec __pyx_CyFunctionType_spec = { + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL) + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + __pyx_CyFunctionType_slots +}; +#else +static PyTypeObject __pyx_CyFunctionType_type = { + PyVarObject_HEAD_INIT(0, 0) + __PYX_TYPE_MODULE_PREFIX "cython_function_or_method", + sizeof(__pyx_CyFunctionObject), + 0, + (destructor) __Pyx_CyFunction_dealloc, +#if !CYTHON_METH_FASTCALL + 0, +#elif CYTHON_BACKPORT_VECTORCALL + (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall), +#else + offsetof(PyCFunctionObject, vectorcall), +#endif + 0, + 0, +#if PY_MAJOR_VERSION < 3 + 0, +#else + 0, +#endif + (reprfunc) __Pyx_CyFunction_repr, + 0, + 0, + 0, + 0, + __Pyx_CyFunction_CallAsMethod, + 0, + 0, + 0, + 0, +#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR + Py_TPFLAGS_METHOD_DESCRIPTOR | +#endif +#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL + _Py_TPFLAGS_HAVE_VECTORCALL | +#endif + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE, + 0, + (traverseproc) __Pyx_CyFunction_traverse, + (inquiry) __Pyx_CyFunction_clear, + 0, +#if PY_VERSION_HEX < 0x030500A0 + offsetof(__pyx_CyFunctionObject, func_weakreflist), +#else + offsetof(PyCFunctionObject, m_weakreflist), +#endif + 0, + 0, + __pyx_CyFunction_methods, + __pyx_CyFunction_members, + __pyx_CyFunction_getsets, + 0, + 0, + __Pyx_PyMethod_New, + 0, + offsetof(__pyx_CyFunctionObject, func_dict), + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, +#if PY_VERSION_HEX >= 0x030400a1 + 0, +#endif +#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, +#endif +#if __PYX_NEED_TP_PRINT_SLOT + 0, +#endif +#if PY_VERSION_HEX >= 0x030C0000 + 0, +#endif +#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, +#endif +}; +#endif +static int __pyx_CyFunction_init(PyObject *module) { +#if CYTHON_USE_TYPE_SPECS + __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL); +#else + CYTHON_UNUSED_VAR(module); + __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); +#endif + if (unlikely(__pyx_CyFunctionType == NULL)) { + return -1; + } + return 0; +} +static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults = PyObject_Malloc(size); + if (unlikely(!m->defaults)) + return PyErr_NoMemory(); + memset(m->defaults, 0, size); + m->defaults_pyobjects = pyobjects; + m->defaults_size = size; + return m->defaults; +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_tuple = tuple; + Py_INCREF(tuple); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->defaults_kwdict = dict; + Py_INCREF(dict); +} +static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; + m->func_annotations = dict; + Py_INCREF(dict); +} + +/* CythonFunction */ +static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname, + PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { + PyObject *op = __Pyx_CyFunction_Init( + PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType), + ml, flags, qualname, closure, module, globals, code + ); + if (likely(op)) { + PyObject_GC_Track(op); + } + return op; +} + +/* decode_c_string */ +static CYTHON_INLINE PyObject* __Pyx_decode_c_string( + const char* cstring, Py_ssize_t start, Py_ssize_t stop, + const char* encoding, const char* errors, + PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { + Py_ssize_t length; + if (unlikely((start < 0) | (stop < 0))) { + size_t slen = strlen(cstring); + if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, + "c-string too long to convert to Python"); + return NULL; + } + length = (Py_ssize_t) slen; + if (start < 0) { + start += length; + if (start < 0) + start = 0; + } + if (stop < 0) + stop += length; + } + if (unlikely(stop <= start)) + return __Pyx_NewRef(__pyx_empty_unicode); + length = stop - start; + cstring += start; + if (decode_func) { + return decode_func(cstring, length, errors); + } else { + return PyUnicode_Decode(cstring, length, encoding, errors); + } +} + +/* CLineInTraceback */ +#ifndef CYTHON_CLINE_IN_TRACEBACK +static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { + PyObject *use_cline; + PyObject *ptype, *pvalue, *ptraceback; +#if CYTHON_COMPILING_IN_CPYTHON + PyObject **cython_runtime_dict; +#endif + CYTHON_MAYBE_UNUSED_VAR(tstate); + if (unlikely(!__pyx_cython_runtime)) { + return c_line; + } + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); +#if CYTHON_COMPILING_IN_CPYTHON + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + if (likely(cython_runtime_dict)) { + __PYX_PY_DICT_LOOKUP_IF_MODIFIED( + use_cline, *cython_runtime_dict, + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + } else +#endif + { + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + if (use_cline_obj) { + use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_DECREF(use_cline_obj); + } else { + PyErr_Clear(); + use_cline = NULL; + } + } + if (!use_cline) { + c_line = 0; + (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + } + else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { + c_line = 0; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + return c_line; +} +#endif + +/* CodeObjectCache */ +#if !CYTHON_COMPILING_IN_LIMITED_API +static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; + } + while (start < end) { + mid = start + (end - start) / 2; + if (code_line < entries[mid].code_line) { + end = mid; + } else if (code_line > entries[mid].code_line) { + start = mid + 1; + } else { + return mid; + } + } + if (code_line <= entries[mid].code_line) { + return mid; + } else { + return mid + 1; + } +} +static PyCodeObject *__pyx_find_code_object(int code_line) { + PyCodeObject* code_object; + int pos; + if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + return NULL; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + return NULL; + } + code_object = __pyx_code_cache.entries[pos].code_object; + Py_INCREF(code_object); + return code_object; +} +static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { + int pos, i; + __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + if (unlikely(!code_line)) { + return; + } + if (unlikely(!entries)) { + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); + if (likely(entries)) { + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = 64; + __pyx_code_cache.count = 1; + entries[0].code_line = code_line; + entries[0].code_object = code_object; + Py_INCREF(code_object); + } + return; + } + pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); + if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { + PyCodeObject* tmp = entries[pos].code_object; + entries[pos].code_object = code_object; + Py_DECREF(tmp); + return; + } + if (__pyx_code_cache.count == __pyx_code_cache.max_count) { + int new_max = __pyx_code_cache.max_count + 64; + entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( + __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + if (unlikely(!entries)) { + return; + } + __pyx_code_cache.entries = entries; + __pyx_code_cache.max_count = new_max; + } + for (i=__pyx_code_cache.count; i>pos; i--) { + entries[i] = entries[i-1]; + } + entries[pos].code_line = code_line; + entries[pos].code_object = code_object; + __pyx_code_cache.count++; + Py_INCREF(code_object); +} +#endif + +/* AddTraceback */ +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" +#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API + #ifndef Py_BUILD_CORE + #define Py_BUILD_CORE 1 + #endif + #include "internal/pycore_frame.h" +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict, + PyObject *firstlineno, PyObject *name) { + PyObject *replace = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; + replace = PyObject_GetAttrString(code, "replace"); + if (likely(replace)) { + PyObject *result; + result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + Py_DECREF(replace); + return result; + } + PyErr_Clear(); + #if __PYX_LIMITED_VERSION_HEX < 0x030780000 + { + PyObject *compiled = NULL, *result = NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; + if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; + compiled = Py_CompileString( + "out = type(code)(\n" + " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" + " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" + " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" + " code.co_lnotab)\n", "", Py_file_input); + if (!compiled) return NULL; + result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); + Py_DECREF(compiled); + if (!result) PyErr_Print(); + Py_DECREF(result); + result = PyDict_GetItemString(scratch_dict, "out"); + if (result) Py_INCREF(result); + return result; + } + #else + return NULL; + #endif +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL; + PyObject *replace = NULL, *getframe = NULL, *frame = NULL; + PyObject *exc_type, *exc_value, *exc_traceback; + int success = 0; + if (c_line) { + (void) __pyx_cfilenm; + (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); + } + PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + getframe = PySys_GetObject("_getframe"); + if (unlikely(!getframe)) goto bad; + if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; + frame = PyEval_EvalCode(code_object, dict, dict); + if (unlikely(!frame) || frame == Py_None) goto bad; + success = 1; + bad: + PyErr_Restore(exc_type, exc_value, exc_traceback); + Py_XDECREF(code_object); + Py_XDECREF(py_py_line); + Py_XDECREF(py_funcname); + Py_XDECREF(dict); + Py_XDECREF(replace); + if (success) { + PyTraceBack_Here( + (struct _frame*)frame); + } + Py_XDECREF(frame); +} +#else +static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( + const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = NULL; + PyObject *py_funcname = NULL; + #if PY_MAJOR_VERSION < 3 + PyObject *py_srcfile = NULL; + py_srcfile = PyString_FromString(filename); + if (!py_srcfile) goto bad; + #endif + if (c_line) { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + #else + py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); + if (!py_funcname) goto bad; + funcname = PyUnicode_AsUTF8(py_funcname); + if (!funcname) goto bad; + #endif + } + else { + #if PY_MAJOR_VERSION < 3 + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + #endif + } + #if PY_MAJOR_VERSION < 3 + py_code = __Pyx_PyCode_New( + 0, + 0, + 0, + 0, + 0, + 0, + __pyx_empty_bytes, /*PyObject *code,*/ + __pyx_empty_tuple, /*PyObject *consts,*/ + __pyx_empty_tuple, /*PyObject *names,*/ + __pyx_empty_tuple, /*PyObject *varnames,*/ + __pyx_empty_tuple, /*PyObject *freevars,*/ + __pyx_empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + py_line, + __pyx_empty_bytes /*PyObject *lnotab*/ + ); + Py_DECREF(py_srcfile); + #else + py_code = PyCode_NewEmpty(filename, funcname, py_line); + #endif + Py_XDECREF(py_funcname); + return py_code; +bad: + Py_XDECREF(py_funcname); + #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_srcfile); + #endif + return NULL; +} +static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject *ptype, *pvalue, *ptraceback; + if (c_line) { + c_line = __Pyx_CLineForTraceback(tstate, c_line); + } + py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) { + /* If the code object creation fails, then we should clear the + fetched exception references and propagate the new exception */ + Py_XDECREF(ptype); + Py_XDECREF(pvalue); + Py_XDECREF(ptraceback); + goto bad; + } + __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); + __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( + tstate, /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + __pyx_d, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} +#endif + +/* CIntFromPyVerify */ +#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) +#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ + {\ + func_type value = func_value;\ + if (sizeof(target_type) < sizeof(func_type)) {\ + if (unlikely(value != (func_type) (target_type) value)) {\ + func_type zero = 0;\ + if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ + return (target_type) -1;\ + if (is_unsigned && unlikely(value < zero))\ + goto raise_neg_overflow;\ + else\ + goto raise_overflow;\ + }\ + }\ + return (target_type) value;\ + } + +/* CIntFromPy */ +static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) { + return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) { + return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) { + return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) { + return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (int) -1; + } + } else { + int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to int"); + return (int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to int"); + return (int) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(long), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned long) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(unsigned long) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(unsigned long), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned long)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mpfr_prec_t(mpfr_prec_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const mpfr_prec_t neg_one = (mpfr_prec_t) -1, const_zero = (mpfr_prec_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(mpfr_prec_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(mpfr_prec_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mpfr_prec_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(mpfr_prec_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mpfr_prec_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(mpfr_prec_t), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(mpfr_prec_t)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mpfr_rnd_t(mpfr_rnd_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const mpfr_rnd_t neg_one = (mpfr_rnd_t) -1, const_zero = (mpfr_rnd_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(mpfr_rnd_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(mpfr_rnd_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mpfr_rnd_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(mpfr_rnd_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mpfr_rnd_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(mpfr_rnd_t), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(mpfr_rnd_t)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mpfr_free_cache_t(mpfr_free_cache_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const mpfr_free_cache_t neg_one = (mpfr_free_cache_t) -1, const_zero = (mpfr_free_cache_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(mpfr_free_cache_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(mpfr_free_cache_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mpfr_free_cache_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(mpfr_free_cache_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mpfr_free_cache_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(mpfr_free_cache_t), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(mpfr_free_cache_t)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntFromPy */ +static CYTHON_INLINE mpfr_free_cache_t __Pyx_PyInt_As_mpfr_free_cache_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const mpfr_free_cache_t neg_one = (mpfr_free_cache_t) -1, const_zero = (mpfr_free_cache_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(mpfr_free_cache_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (mpfr_free_cache_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(mpfr_free_cache_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_free_cache_t) >= 2 * PyLong_SHIFT)) { + return (mpfr_free_cache_t) (((((mpfr_free_cache_t)digits[1]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(mpfr_free_cache_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_free_cache_t) >= 3 * PyLong_SHIFT)) { + return (mpfr_free_cache_t) (((((((mpfr_free_cache_t)digits[2]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[1]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(mpfr_free_cache_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_free_cache_t) >= 4 * PyLong_SHIFT)) { + return (mpfr_free_cache_t) (((((((((mpfr_free_cache_t)digits[3]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[2]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[1]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (mpfr_free_cache_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(mpfr_free_cache_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_free_cache_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(mpfr_free_cache_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_free_cache_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(mpfr_free_cache_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_free_cache_t) - 1 > 2 * PyLong_SHIFT)) { + return (mpfr_free_cache_t) (((mpfr_free_cache_t)-1)*(((((mpfr_free_cache_t)digits[1]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(mpfr_free_cache_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_free_cache_t) - 1 > 2 * PyLong_SHIFT)) { + return (mpfr_free_cache_t) ((((((mpfr_free_cache_t)digits[1]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(mpfr_free_cache_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_free_cache_t) - 1 > 3 * PyLong_SHIFT)) { + return (mpfr_free_cache_t) (((mpfr_free_cache_t)-1)*(((((((mpfr_free_cache_t)digits[2]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[1]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(mpfr_free_cache_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_free_cache_t) - 1 > 3 * PyLong_SHIFT)) { + return (mpfr_free_cache_t) ((((((((mpfr_free_cache_t)digits[2]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[1]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(mpfr_free_cache_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_free_cache_t) - 1 > 4 * PyLong_SHIFT)) { + return (mpfr_free_cache_t) (((mpfr_free_cache_t)-1)*(((((((((mpfr_free_cache_t)digits[3]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[2]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[1]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(mpfr_free_cache_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_free_cache_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_free_cache_t) - 1 > 4 * PyLong_SHIFT)) { + return (mpfr_free_cache_t) ((((((((((mpfr_free_cache_t)digits[3]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[2]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[1]) << PyLong_SHIFT) | (mpfr_free_cache_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(mpfr_free_cache_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_free_cache_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(mpfr_free_cache_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_free_cache_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available, cannot convert large enums"); + return (mpfr_free_cache_t) -1; + } else { + mpfr_free_cache_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (mpfr_free_cache_t) -1; + val = __Pyx_PyInt_As_mpfr_free_cache_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to mpfr_free_cache_t"); + return (mpfr_free_cache_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to mpfr_free_cache_t"); + return (mpfr_free_cache_t) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mp_exp_t(mp_exp_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const mp_exp_t neg_one = (mp_exp_t) -1, const_zero = (mp_exp_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(mp_exp_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(mp_exp_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mp_exp_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(mp_exp_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mp_exp_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(mp_exp_t), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(mp_exp_t)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_mpfr_flags_t(mpfr_flags_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const mpfr_flags_t neg_one = (mpfr_flags_t) -1, const_zero = (mpfr_flags_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(mpfr_flags_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(mpfr_flags_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mpfr_flags_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(mpfr_flags_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(mpfr_flags_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(mpfr_flags_t), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(mpfr_flags_t)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntFromPy */ +static CYTHON_INLINE mpfr_prec_t __Pyx_PyInt_As_mpfr_prec_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const mpfr_prec_t neg_one = (mpfr_prec_t) -1, const_zero = (mpfr_prec_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(mpfr_prec_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (mpfr_prec_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(mpfr_prec_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_prec_t) >= 2 * PyLong_SHIFT)) { + return (mpfr_prec_t) (((((mpfr_prec_t)digits[1]) << PyLong_SHIFT) | (mpfr_prec_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(mpfr_prec_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_prec_t) >= 3 * PyLong_SHIFT)) { + return (mpfr_prec_t) (((((((mpfr_prec_t)digits[2]) << PyLong_SHIFT) | (mpfr_prec_t)digits[1]) << PyLong_SHIFT) | (mpfr_prec_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(mpfr_prec_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_prec_t) >= 4 * PyLong_SHIFT)) { + return (mpfr_prec_t) (((((((((mpfr_prec_t)digits[3]) << PyLong_SHIFT) | (mpfr_prec_t)digits[2]) << PyLong_SHIFT) | (mpfr_prec_t)digits[1]) << PyLong_SHIFT) | (mpfr_prec_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (mpfr_prec_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(mpfr_prec_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_prec_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(mpfr_prec_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_prec_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(mpfr_prec_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_prec_t) - 1 > 2 * PyLong_SHIFT)) { + return (mpfr_prec_t) (((mpfr_prec_t)-1)*(((((mpfr_prec_t)digits[1]) << PyLong_SHIFT) | (mpfr_prec_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(mpfr_prec_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_prec_t) - 1 > 2 * PyLong_SHIFT)) { + return (mpfr_prec_t) ((((((mpfr_prec_t)digits[1]) << PyLong_SHIFT) | (mpfr_prec_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(mpfr_prec_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_prec_t) - 1 > 3 * PyLong_SHIFT)) { + return (mpfr_prec_t) (((mpfr_prec_t)-1)*(((((((mpfr_prec_t)digits[2]) << PyLong_SHIFT) | (mpfr_prec_t)digits[1]) << PyLong_SHIFT) | (mpfr_prec_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(mpfr_prec_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_prec_t) - 1 > 3 * PyLong_SHIFT)) { + return (mpfr_prec_t) ((((((((mpfr_prec_t)digits[2]) << PyLong_SHIFT) | (mpfr_prec_t)digits[1]) << PyLong_SHIFT) | (mpfr_prec_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(mpfr_prec_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_prec_t) - 1 > 4 * PyLong_SHIFT)) { + return (mpfr_prec_t) (((mpfr_prec_t)-1)*(((((((((mpfr_prec_t)digits[3]) << PyLong_SHIFT) | (mpfr_prec_t)digits[2]) << PyLong_SHIFT) | (mpfr_prec_t)digits[1]) << PyLong_SHIFT) | (mpfr_prec_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(mpfr_prec_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_prec_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_prec_t) - 1 > 4 * PyLong_SHIFT)) { + return (mpfr_prec_t) ((((((((((mpfr_prec_t)digits[3]) << PyLong_SHIFT) | (mpfr_prec_t)digits[2]) << PyLong_SHIFT) | (mpfr_prec_t)digits[1]) << PyLong_SHIFT) | (mpfr_prec_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(mpfr_prec_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_prec_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(mpfr_prec_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_prec_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + mpfr_prec_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (mpfr_prec_t) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (mpfr_prec_t) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (mpfr_prec_t) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (mpfr_prec_t) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (mpfr_prec_t) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(mpfr_prec_t) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((mpfr_prec_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(mpfr_prec_t) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((mpfr_prec_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((mpfr_prec_t) 1) << (sizeof(mpfr_prec_t) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (mpfr_prec_t) -1; + } + } else { + mpfr_prec_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (mpfr_prec_t) -1; + val = __Pyx_PyInt_As_mpfr_prec_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to mpfr_prec_t"); + return (mpfr_prec_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to mpfr_prec_t"); + return (mpfr_prec_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE mpfr_rnd_t __Pyx_PyInt_As_mpfr_rnd_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const mpfr_rnd_t neg_one = (mpfr_rnd_t) -1, const_zero = (mpfr_rnd_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(mpfr_rnd_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (mpfr_rnd_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(mpfr_rnd_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_rnd_t) >= 2 * PyLong_SHIFT)) { + return (mpfr_rnd_t) (((((mpfr_rnd_t)digits[1]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(mpfr_rnd_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_rnd_t) >= 3 * PyLong_SHIFT)) { + return (mpfr_rnd_t) (((((((mpfr_rnd_t)digits[2]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[1]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(mpfr_rnd_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_rnd_t) >= 4 * PyLong_SHIFT)) { + return (mpfr_rnd_t) (((((((((mpfr_rnd_t)digits[3]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[2]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[1]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (mpfr_rnd_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(mpfr_rnd_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_rnd_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(mpfr_rnd_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_rnd_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(mpfr_rnd_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_rnd_t) - 1 > 2 * PyLong_SHIFT)) { + return (mpfr_rnd_t) (((mpfr_rnd_t)-1)*(((((mpfr_rnd_t)digits[1]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(mpfr_rnd_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_rnd_t) - 1 > 2 * PyLong_SHIFT)) { + return (mpfr_rnd_t) ((((((mpfr_rnd_t)digits[1]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(mpfr_rnd_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_rnd_t) - 1 > 3 * PyLong_SHIFT)) { + return (mpfr_rnd_t) (((mpfr_rnd_t)-1)*(((((((mpfr_rnd_t)digits[2]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[1]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(mpfr_rnd_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_rnd_t) - 1 > 3 * PyLong_SHIFT)) { + return (mpfr_rnd_t) ((((((((mpfr_rnd_t)digits[2]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[1]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(mpfr_rnd_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_rnd_t) - 1 > 4 * PyLong_SHIFT)) { + return (mpfr_rnd_t) (((mpfr_rnd_t)-1)*(((((((((mpfr_rnd_t)digits[3]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[2]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[1]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(mpfr_rnd_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_rnd_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_rnd_t) - 1 > 4 * PyLong_SHIFT)) { + return (mpfr_rnd_t) ((((((((((mpfr_rnd_t)digits[3]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[2]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[1]) << PyLong_SHIFT) | (mpfr_rnd_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(mpfr_rnd_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_rnd_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(mpfr_rnd_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_rnd_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available, cannot convert large enums"); + return (mpfr_rnd_t) -1; + } else { + mpfr_rnd_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (mpfr_rnd_t) -1; + val = __Pyx_PyInt_As_mpfr_rnd_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to mpfr_rnd_t"); + return (mpfr_rnd_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to mpfr_rnd_t"); + return (mpfr_rnd_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(unsigned long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(unsigned long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (unsigned long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(unsigned long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(unsigned long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned long) >= 2 * PyLong_SHIFT)) { + return (unsigned long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned long) >= 3 * PyLong_SHIFT)) { + return (unsigned long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned long) >= 4 * PyLong_SHIFT)) { + return (unsigned long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(unsigned long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(unsigned long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(unsigned long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { + return (unsigned long) (((unsigned long)-1)*(((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(unsigned long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { + return (unsigned long) ((((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { + return (unsigned long) (((unsigned long)-1)*(((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { + return (unsigned long) ((((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT)) { + return (unsigned long) (((unsigned long)-1)*(((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT)) { + return (unsigned long) ((((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(unsigned long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(unsigned long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + unsigned long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (unsigned long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (unsigned long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (unsigned long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (unsigned long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(unsigned long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((unsigned long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(unsigned long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((unsigned long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((unsigned long) 1) << (sizeof(unsigned long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (unsigned long) -1; + } + } else { + unsigned long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (unsigned long) -1; + val = __Pyx_PyInt_As_unsigned_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to unsigned long"); + return (unsigned long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned long"); + return (unsigned long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const long neg_one = (long) -1, const_zero = (long) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(long) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (long) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) { + return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) { + return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) { + return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(long) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) { + return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(long) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + long val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (long) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (long) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (long) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (long) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (long) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((long) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (long) -1; + } + } else { + long val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to long"); + return (long) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to long"); + return (long) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE mp_exp_t __Pyx_PyInt_As_mp_exp_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const mp_exp_t neg_one = (mp_exp_t) -1, const_zero = (mp_exp_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(mp_exp_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (mp_exp_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(mp_exp_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mp_exp_t) >= 2 * PyLong_SHIFT)) { + return (mp_exp_t) (((((mp_exp_t)digits[1]) << PyLong_SHIFT) | (mp_exp_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(mp_exp_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mp_exp_t) >= 3 * PyLong_SHIFT)) { + return (mp_exp_t) (((((((mp_exp_t)digits[2]) << PyLong_SHIFT) | (mp_exp_t)digits[1]) << PyLong_SHIFT) | (mp_exp_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(mp_exp_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mp_exp_t) >= 4 * PyLong_SHIFT)) { + return (mp_exp_t) (((((((((mp_exp_t)digits[3]) << PyLong_SHIFT) | (mp_exp_t)digits[2]) << PyLong_SHIFT) | (mp_exp_t)digits[1]) << PyLong_SHIFT) | (mp_exp_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (mp_exp_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(mp_exp_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(mp_exp_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(mp_exp_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(mp_exp_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(mp_exp_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mp_exp_t) - 1 > 2 * PyLong_SHIFT)) { + return (mp_exp_t) (((mp_exp_t)-1)*(((((mp_exp_t)digits[1]) << PyLong_SHIFT) | (mp_exp_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(mp_exp_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mp_exp_t) - 1 > 2 * PyLong_SHIFT)) { + return (mp_exp_t) ((((((mp_exp_t)digits[1]) << PyLong_SHIFT) | (mp_exp_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(mp_exp_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mp_exp_t) - 1 > 3 * PyLong_SHIFT)) { + return (mp_exp_t) (((mp_exp_t)-1)*(((((((mp_exp_t)digits[2]) << PyLong_SHIFT) | (mp_exp_t)digits[1]) << PyLong_SHIFT) | (mp_exp_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(mp_exp_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mp_exp_t) - 1 > 3 * PyLong_SHIFT)) { + return (mp_exp_t) ((((((((mp_exp_t)digits[2]) << PyLong_SHIFT) | (mp_exp_t)digits[1]) << PyLong_SHIFT) | (mp_exp_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(mp_exp_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mp_exp_t) - 1 > 4 * PyLong_SHIFT)) { + return (mp_exp_t) (((mp_exp_t)-1)*(((((((((mp_exp_t)digits[3]) << PyLong_SHIFT) | (mp_exp_t)digits[2]) << PyLong_SHIFT) | (mp_exp_t)digits[1]) << PyLong_SHIFT) | (mp_exp_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(mp_exp_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mp_exp_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mp_exp_t) - 1 > 4 * PyLong_SHIFT)) { + return (mp_exp_t) ((((((((((mp_exp_t)digits[3]) << PyLong_SHIFT) | (mp_exp_t)digits[2]) << PyLong_SHIFT) | (mp_exp_t)digits[1]) << PyLong_SHIFT) | (mp_exp_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(mp_exp_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(mp_exp_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(mp_exp_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(mp_exp_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + mp_exp_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (mp_exp_t) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (mp_exp_t) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (mp_exp_t) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (mp_exp_t) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (mp_exp_t) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(mp_exp_t) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((mp_exp_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(mp_exp_t) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((mp_exp_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((mp_exp_t) 1) << (sizeof(mp_exp_t) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (mp_exp_t) -1; + } + } else { + mp_exp_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (mp_exp_t) -1; + val = __Pyx_PyInt_As_mp_exp_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to mp_exp_t"); + return (mp_exp_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to mp_exp_t"); + return (mp_exp_t) -1; +} + +/* CIntFromPy */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(size_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(size_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(size_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (size_t) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (size_t) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (size_t) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (size_t) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((size_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((size_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const int neg_one = (int) -1, const_zero = (int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntFromPy */ +static CYTHON_INLINE mpfr_flags_t __Pyx_PyInt_As_mpfr_flags_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const mpfr_flags_t neg_one = (mpfr_flags_t) -1, const_zero = (mpfr_flags_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(mpfr_flags_t) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (mpfr_flags_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(mpfr_flags_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_flags_t) >= 2 * PyLong_SHIFT)) { + return (mpfr_flags_t) (((((mpfr_flags_t)digits[1]) << PyLong_SHIFT) | (mpfr_flags_t)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(mpfr_flags_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_flags_t) >= 3 * PyLong_SHIFT)) { + return (mpfr_flags_t) (((((((mpfr_flags_t)digits[2]) << PyLong_SHIFT) | (mpfr_flags_t)digits[1]) << PyLong_SHIFT) | (mpfr_flags_t)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(mpfr_flags_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_flags_t) >= 4 * PyLong_SHIFT)) { + return (mpfr_flags_t) (((((((((mpfr_flags_t)digits[3]) << PyLong_SHIFT) | (mpfr_flags_t)digits[2]) << PyLong_SHIFT) | (mpfr_flags_t)digits[1]) << PyLong_SHIFT) | (mpfr_flags_t)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (mpfr_flags_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(mpfr_flags_t) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_flags_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(mpfr_flags_t) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_flags_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(mpfr_flags_t) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_flags_t) - 1 > 2 * PyLong_SHIFT)) { + return (mpfr_flags_t) (((mpfr_flags_t)-1)*(((((mpfr_flags_t)digits[1]) << PyLong_SHIFT) | (mpfr_flags_t)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(mpfr_flags_t) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_flags_t) - 1 > 2 * PyLong_SHIFT)) { + return (mpfr_flags_t) ((((((mpfr_flags_t)digits[1]) << PyLong_SHIFT) | (mpfr_flags_t)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(mpfr_flags_t) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_flags_t) - 1 > 3 * PyLong_SHIFT)) { + return (mpfr_flags_t) (((mpfr_flags_t)-1)*(((((((mpfr_flags_t)digits[2]) << PyLong_SHIFT) | (mpfr_flags_t)digits[1]) << PyLong_SHIFT) | (mpfr_flags_t)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(mpfr_flags_t) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_flags_t) - 1 > 3 * PyLong_SHIFT)) { + return (mpfr_flags_t) ((((((((mpfr_flags_t)digits[2]) << PyLong_SHIFT) | (mpfr_flags_t)digits[1]) << PyLong_SHIFT) | (mpfr_flags_t)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(mpfr_flags_t) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_flags_t) - 1 > 4 * PyLong_SHIFT)) { + return (mpfr_flags_t) (((mpfr_flags_t)-1)*(((((((((mpfr_flags_t)digits[3]) << PyLong_SHIFT) | (mpfr_flags_t)digits[2]) << PyLong_SHIFT) | (mpfr_flags_t)digits[1]) << PyLong_SHIFT) | (mpfr_flags_t)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(mpfr_flags_t) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(mpfr_flags_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(mpfr_flags_t) - 1 > 4 * PyLong_SHIFT)) { + return (mpfr_flags_t) ((((((((((mpfr_flags_t)digits[3]) << PyLong_SHIFT) | (mpfr_flags_t)digits[2]) << PyLong_SHIFT) | (mpfr_flags_t)digits[1]) << PyLong_SHIFT) | (mpfr_flags_t)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(mpfr_flags_t) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_flags_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(mpfr_flags_t) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(mpfr_flags_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + mpfr_flags_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (mpfr_flags_t) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (mpfr_flags_t) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (mpfr_flags_t) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (mpfr_flags_t) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (mpfr_flags_t) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(mpfr_flags_t) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((mpfr_flags_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(mpfr_flags_t) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((mpfr_flags_t) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((mpfr_flags_t) 1) << (sizeof(mpfr_flags_t) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (mpfr_flags_t) -1; + } + } else { + mpfr_flags_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (mpfr_flags_t) -1; + val = __Pyx_PyInt_As_mpfr_flags_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to mpfr_flags_t"); + return (mpfr_flags_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to mpfr_flags_t"); + return (mpfr_flags_t) -1; +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ptrdiff_t(ptrdiff_t value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const ptrdiff_t neg_one = (ptrdiff_t) -1, const_zero = (ptrdiff_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(ptrdiff_t) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(ptrdiff_t) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(ptrdiff_t) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(ptrdiff_t) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(ptrdiff_t), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(ptrdiff_t)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntToPy */ +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(unsigned int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +#endif + } + } else { + if (sizeof(unsigned int) <= sizeof(long)) { + return PyInt_FromLong((long) value); +#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); +#endif + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; +#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000 + return _PyLong_FromByteArray(bytes, sizeof(unsigned int), + little, !is_unsigned); +#else + PyObject *from_bytes, *result = NULL; + PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); + if (!from_bytes) return NULL; + py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(unsigned int)); + if (!py_bytes) goto limited_bad; + order_str = PyUnicode_FromString(little ? "little" : "big"); + if (!order_str) goto limited_bad; + arg_tuple = PyTuple_Pack(2, py_bytes, order_str); + if (!arg_tuple) goto limited_bad; + if (!is_unsigned) { + kwds = PyDict_New(); + if (!kwds) goto limited_bad; + if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + } + result = PyObject_Call(from_bytes, arg_tuple, kwds); + limited_bad: + Py_XDECREF(kwds); + Py_XDECREF(arg_tuple); + Py_XDECREF(order_str); + Py_XDECREF(py_bytes); + Py_XDECREF(from_bytes); + return result; +#endif + } +} + +/* CIntFromPy */ +static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if ((sizeof(unsigned int) < sizeof(long))) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (unsigned int) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + if (unlikely(__Pyx_PyLong_IsNeg(x))) { + goto raise_neg_overflow; + } else if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(unsigned int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_DigitCount(x)) { + case 2: + if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT)) { + return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 3: + if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT)) { + return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + case 4: + if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT)) { + return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])); + } + } + break; + } + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7 + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned int) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if ((sizeof(unsigned int) <= sizeof(unsigned long))) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + if (__Pyx_PyLong_IsCompact(x)) { + __PYX_VERIFY_RETURN_INT(unsigned int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x)) + } else { + const digit* digits = __Pyx_PyLong_Digits(x); + assert(__Pyx_PyLong_DigitCount(x) > 1); + switch (__Pyx_PyLong_SignedDigitCount(x)) { + case -2: + if ((8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) { + return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 2: + if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) { + return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -3: + if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) { + return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 3: + if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) { + return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case -4: + if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) { + return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + case 4: + if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) { + if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) { + __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) { + return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]))); + } + } + break; + } + } +#endif + if ((sizeof(unsigned int) <= sizeof(long))) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if ((sizeof(unsigned int) <= sizeof(PY_LONG_LONG))) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { + unsigned int val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); +#if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } +#endif + if (likely(v)) { + int ret = -1; +#if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray) + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); +#else + PyObject *stepval = NULL, *mask = NULL, *shift = NULL; + int bits, remaining_bits, is_negative = 0; + long idigit; + int chunk_size = (sizeof(long) < 8) ? 30 : 62; + if (unlikely(!PyLong_CheckExact(v))) { + PyObject *tmp = v; + v = PyNumber_Long(v); + assert(PyLong_CheckExact(v)); + Py_DECREF(tmp); + if (unlikely(!v)) return (unsigned int) -1; + } +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(x) == 0) + return (unsigned int) 0; + is_negative = Py_SIZE(x) < 0; +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (unsigned int) -1; + is_negative = result == 1; + } +#endif + if (is_unsigned && unlikely(is_negative)) { + goto raise_neg_overflow; + } else if (is_negative) { + stepval = PyNumber_Invert(v); + if (unlikely(!stepval)) + return (unsigned int) -1; + } else { + stepval = __Pyx_NewRef(v); + } + val = (unsigned int) 0; + mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done; + shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done; + for (bits = 0; bits < (int) sizeof(unsigned int) * 8 - chunk_size; bits += chunk_size) { + PyObject *tmp, *digit; + digit = PyNumber_And(stepval, mask); + if (unlikely(!digit)) goto done; + idigit = PyLong_AsLong(digit); + Py_DECREF(digit); + if (unlikely(idigit < 0)) goto done; + tmp = PyNumber_Rshift(stepval, shift); + if (unlikely(!tmp)) goto done; + Py_DECREF(stepval); stepval = tmp; + val |= ((unsigned int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + if (Py_SIZE(stepval) == 0) + goto unpacking_done; + #endif + } + idigit = PyLong_AsLong(stepval); + if (unlikely(idigit < 0)) goto done; + remaining_bits = ((int) sizeof(unsigned int) * 8) - bits - (is_unsigned ? 0 : 1); + if (unlikely(idigit >= (1L << remaining_bits))) + goto raise_overflow; + val |= ((unsigned int) idigit) << bits; + #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000 + unpacking_done: + #endif + if (!is_unsigned) { + if (unlikely(val & (((unsigned int) 1) << (sizeof(unsigned int) * 8 - 1)))) + goto raise_overflow; + if (is_negative) + val = ~val; + } + ret = 0; + done: + Py_XDECREF(shift); + Py_XDECREF(mask); + Py_XDECREF(stepval); +#endif + Py_DECREF(v); + if (likely(!ret)) + return val; + } + return (unsigned int) -1; + } + } else { + unsigned int val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (unsigned int) -1; + val = __Pyx_PyInt_As_unsigned_int(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to unsigned int"); + return (unsigned int) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to unsigned int"); + return (unsigned int) -1; +} + +/* FormatTypeName */ +#if CYTHON_COMPILING_IN_LIMITED_API +static __Pyx_TypeName +__Pyx_PyType_GetName(PyTypeObject* tp) +{ + PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_n_s_name); + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { + PyErr_Clear(); + Py_XDECREF(name); + name = __Pyx_NewRef(__pyx_n_s__283); + } + return name; +} +#endif + +/* FastTypeChecks */ +#if CYTHON_COMPILING_IN_CPYTHON +static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { + while (a) { + a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*); + if (a == b) + return 1; + } + return b == &PyBaseObject_Type; +} +static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (a == b) return 1; + mro = a->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(a, b); +} +static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) { + PyObject *mro; + if (cls == a || cls == b) return 1; + mro = cls->tp_mro; + if (likely(mro)) { + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyObject *base = PyTuple_GET_ITEM(mro, i); + if (base == (PyObject *)a || base == (PyObject *)b) + return 1; + } + return 0; + } + return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); +} +#if PY_MAJOR_VERSION == 2 +static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { + PyObject *exception, *value, *tb; + int res; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&exception, &value, &tb); + res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + if (!res) { + res = PyObject_IsSubclass(err, exc_type2); + if (unlikely(res == -1)) { + PyErr_WriteUnraisable(err); + res = 0; + } + } + __Pyx_ErrRestore(exception, value, tb); + return res; +} +#else +static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { + if (exc_type1) { + return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); + } else { + return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); + } +} +#endif +static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { + Py_ssize_t i, n; + assert(PyExceptionClass_Check(exc_type)); + n = PyTuple_GET_SIZE(tuple); +#if PY_MAJOR_VERSION >= 3 + for (i=0; i= 0x030B00A4 + return Py_Version & ~0xFFUL; +#else + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; + ++i; + } + return version; +#endif +} +static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { + const unsigned long MAJOR_MINOR = 0xFFFF0000UL; + if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) + return 0; + if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR))) + return 1; + { + char message[200]; + PyOS_snprintf(message, sizeof(message), + "compile time Python version %d.%d " + "of module '%.100s' " + "%s " + "runtime version %d.%d", + (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF), + __Pyx_MODULE_NAME, + (allow_newer) ? "was newer than" : "does not match", + (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF) + ); + return PyErr_WarnEx(NULL, message, 1); + } +} + +/* InitStrings */ +#if PY_MAJOR_VERSION >= 3 +static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { + if (t.is_unicode | t.is_str) { + if (t.intern) { + *str = PyUnicode_InternFromString(t.s); + } else if (t.encoding) { + *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); + } else { + *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); + } + } else { + *str = PyBytes_FromStringAndSize(t.s, t.n - 1); + } + if (!*str) + return -1; + if (PyObject_Hash(*str) == -1) + return -1; + return 0; +} +#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION >= 3 + __Pyx_InitString(*t, t->p); + #else + if (t->is_unicode) { + *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); + } else if (t->intern) { + *t->p = PyString_InternFromString(t->s); + } else { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + } + if (!*t->p) + return -1; + if (PyObject_Hash(*t->p) == -1) + return -1; + #endif + ++t; + } + return 0; +} + +#include +static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) { + size_t len = strlen(s); + if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) { + PyErr_SetString(PyExc_OverflowError, "byte string is too long"); + return -1; + } + return (Py_ssize_t) len; +} +static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return __Pyx_PyUnicode_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) { + Py_ssize_t len = __Pyx_ssize_strlen(c_str); + if (unlikely(len < 0)) return NULL; + return PyByteArray_FromStringAndSize(c_str, len); +} +static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); +} +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT +#if !CYTHON_PEP393_ENABLED +static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + char* defenc_c; + PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); + if (!defenc) return NULL; + defenc_c = PyBytes_AS_STRING(defenc); +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + { + char* end = defenc_c + PyBytes_GET_SIZE(defenc); + char* c; + for (c = defenc_c; c < end; c++) { + if ((unsigned char) (*c) >= 128) { + PyUnicode_AsASCIIString(o); + return NULL; + } + } + } +#endif + *length = PyBytes_GET_SIZE(defenc); + return defenc_c; +} +#else +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + if (likely(PyUnicode_IS_ASCII(o))) { + *length = PyUnicode_GET_LENGTH(o); + return PyUnicode_AsUTF8(o); + } else { + PyUnicode_AsASCIIString(o); + return NULL; + } +#else + return PyUnicode_AsUTF8AndSize(o, length); +#endif +} +#endif +#endif +static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT + if ( +#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + __Pyx_sys_getdefaultencoding_not_ascii && +#endif + PyUnicode_Check(o)) { + return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else +#endif +#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) + if (PyByteArray_Check(o)) { + *length = PyByteArray_GET_SIZE(o); + return PyByteArray_AS_STRING(o); + } else +#endif + { + char* result; + int r = PyBytes_AsStringAndSize(o, &result, length); + if (unlikely(r < 0)) { + return NULL; + } else { + return result; + } + } +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { + int is_true = x == Py_True; + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); +} +static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { + int retval; + if (unlikely(!x)) return -1; + retval = __Pyx_PyObject_IsTrue(x); + Py_DECREF(x); + return retval; +} +static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); +#if PY_MAJOR_VERSION >= 3 + if (PyLong_Check(result)) { + if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " + "The ability to return an instance of a strict subclass of int is deprecated, " + "and may be removed in a future version of Python.", + result_type_name)) { + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; + } + __Pyx_DECREF_TypeName(result_type_name); + return result; + } +#endif + PyErr_Format(PyExc_TypeError, + "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", + type_name, type_name, result_type_name); + __Pyx_DECREF_TypeName(result_type_name); + Py_DECREF(result); + return NULL; +} +static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; +#endif + const char *name = NULL; + PyObject *res = NULL; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x) || PyLong_Check(x))) +#else + if (likely(PyLong_Check(x))) +#endif + return __Pyx_NewRef(x); +#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; + #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; + res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; + res = m->nb_long(x); + } + #else + if (likely(m && m->nb_int)) { + name = "int"; + res = m->nb_int(x); + } + #endif +#else + if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { + res = PyNumber_Int(x); + } +#endif + if (likely(res)) { +#if PY_MAJOR_VERSION < 3 + if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { +#else + if (unlikely(!PyLong_CheckExact(res))) { +#endif + return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, + "an integer is required"); + } + return res; +} +static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { + Py_ssize_t ival; + PyObject *x; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(b))) { + if (sizeof(Py_ssize_t) >= sizeof(long)) + return PyInt_AS_LONG(b); + else + return PyInt_AsSsize_t(b); + } +#endif + if (likely(PyLong_CheckExact(b))) { + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(__Pyx_PyLong_IsCompact(b))) { + return __Pyx_PyLong_CompactValue(b); + } else { + const digit* digits = __Pyx_PyLong_Digits(b); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b); + switch (size) { + case 2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -2: + if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -3: + if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case 4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + case -4: + if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { + return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + break; + } + } + #endif + return PyLong_AsSsize_t(b); + } + x = PyNumber_Index(b); + if (!x) return -1; + ival = PyInt_AsSsize_t(x); + Py_DECREF(x); + return ival; +} +static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { + if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { + return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); +#if PY_MAJOR_VERSION < 3 + } else if (likely(PyInt_CheckExact(o))) { + return PyInt_AS_LONG(o); +#endif + } else { + Py_ssize_t ival; + PyObject *x; + x = PyNumber_Index(o); + if (!x) return -1; + ival = PyInt_AsLong(x); + Py_DECREF(x); + return ival; + } +} +static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { + return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); +} +static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { + return PyInt_FromSize_t(ival); +} + + +/* #### Code section: utility_code_pragmas_end ### */ +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +/* #### Code section: end ### */ +#endif /* Py_PYTHON_H */ diff --git a/mpfr.pyx b/mpfr.pyx index 878152d..79bead6 100644 --- a/mpfr.pyx +++ b/mpfr.pyx @@ -37,9 +37,6 @@ cdef extern from "limits.h": # Mpz_t type and functions ############################################################################### -ctypedef void (*free_func) (void *, size_t) - - cdef class Mpz_t: """ GMP integer object. @@ -101,7 +98,7 @@ def mpz_get_str(int base, Mpz_t op not None): """ cdef bytes digits cdef char *c_digits - cdef free_func freefunc + cdef void (*freefunc)(void *, size_t) noexcept cdef size_t c_digits_len if not (2 <= base <= 62 or -36 <= base <= -2): diff --git a/setup.py b/setup.py index 10d0b19..3c4e8dd 100644 --- a/setup.py +++ b/setup.py @@ -208,16 +208,23 @@ if os.path.exists("PKG-INFO"): USE_CYTHON = False else: - USE_CYTHON = True - + try: + from Cython.Build import cythonize + USE_CYTHON = True + except: + print("Failed to import Cython, using pre-generated .c version") + USE_CYTHON = False if USE_CYTHON: - from Cython.Build import cythonize - - extensions = cythonize( - Extension("mpfr", ["mpfr.pyx"], libraries=["mpfr", "gmp"],) - ) -else: + try: + extensions = cythonize( + Extension("mpfr", ["mpfr.pyx"], libraries=["mpfr", "gmp"],) + ) + except: + print("Failed Cythonize, fallback to pre-generated .c version") + USE_CYTHON = False + +if not USE_CYTHON: extensions = [ Extension("mpfr", ["mpfr.c"], libraries=["mpfr", "gmp"],), ]