7#include "nuitka/prelude.h"
12#if PYTHON_VERSION < 0x300
14static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
15 CHECK_OBJECT(operand1);
16 assert(PyInt_CheckExact(operand1));
17 CHECK_OBJECT(operand2);
18 assert(PyInt_CheckExact(operand2));
25#pragma warning(disable : 4101)
27 NUITKA_MAY_BE_UNUSED
bool cbool_result;
28 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
29 NUITKA_MAY_BE_UNUSED
long clong_result;
30 NUITKA_MAY_BE_UNUSED
double cfloat_result;
35 CHECK_OBJECT(operand1);
36 assert(PyInt_CheckExact(operand1));
37 CHECK_OBJECT(operand2);
38 assert(PyInt_CheckExact(operand2));
40 const long a = PyInt_AS_LONG(operand1);
41 const long b = PyInt_AS_LONG(operand2);
43 if (unlikely(b == 0)) {
44 PyThreadState *tstate = PyThreadState_GET();
46 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"division by zero");
47 goto exit_result_exception;
52 goto exit_result_ok_const_float_minus_0_0;
54 goto exit_result_ok_const_float_0_0;
61#if DBL_MANT_DIG < WIDTH_OF_ULONG
62 if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
66 double r = (double)a / (
double)b;
69 goto exit_result_ok_cfloat;
73 PyObject *operand1_object = operand1;
74 PyObject *operand2_object = operand2;
76 PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
77 assert(r != Py_NotImplemented);
80 goto exit_result_object;
84 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
88 if (unlikely(obj_result == NULL)) {
89 goto exit_result_exception;
94exit_result_ok_const_float_0_0:
95 Py_INCREF(const_float_0_0);
96 result = const_float_0_0;
99exit_result_ok_const_float_minus_0_0:
100 Py_INCREF(const_float_minus_0_0);
101 result = const_float_minus_0_0;
107exit_result_exception:
111PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2) {
112 return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_INT(operand1, operand2);
116#if PYTHON_VERSION < 0x300
118static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(PyObject *operand1,
119 PyObject *operand2) {
120 PyTypeObject *type1 = Py_TYPE(operand1);
124#pragma warning(disable : 4101)
126 NUITKA_MAY_BE_UNUSED
bool cbool_result;
127 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
133 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;
134 binaryfunc slot2 = NULL;
136 if (!(type1 == &PyInt_Type)) {
139 slot2 = PyInt_Type.tp_as_number->nb_true_divide;
141 if (slot1 == slot2) {
147 PyObject *x = slot1(operand1, operand2);
149 if (x != Py_NotImplemented) {
151 goto exit_binary_result_object;
154 Py_DECREF_IMMORTAL(x);
158 PyObject *x = slot2(operand1, operand2);
160 if (x != Py_NotImplemented) {
162 goto exit_binary_result_object;
165 Py_DECREF_IMMORTAL(x);
168#if PYTHON_VERSION < 0x300
169 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
171 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
174 PyObject *coerced1 = operand1;
175 PyObject *coerced2 = operand2;
177 int err = c1(&coerced1, &coerced2);
179 if (unlikely(err < 0)) {
180 goto exit_binary_exception;
184 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
186 if (likely(mv == NULL)) {
187 binaryfunc slot = mv->nb_true_divide;
189 if (likely(slot != NULL)) {
190 PyObject *x = slot(coerced1, coerced2);
196 goto exit_binary_result_object;
205 coercion c2 = PyInt_Type.tp_as_number->nb_coerce;
208 PyObject *coerced1 = operand1;
209 PyObject *coerced2 = operand2;
211 int err = c2(&coerced2, &coerced1);
213 if (unlikely(err < 0)) {
214 goto exit_binary_exception;
218 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
220 if (likely(mv == NULL)) {
221 binaryfunc slot = mv->nb_true_divide;
223 if (likely(slot != NULL)) {
224 PyObject *x = slot(coerced1, coerced2);
230 goto exit_binary_result_object;
242 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: '%s' and 'int'", type1->tp_name);
243 goto exit_binary_exception;
245exit_binary_result_object:
248exit_binary_exception:
251static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
252 CHECK_OBJECT(operand1);
253 CHECK_OBJECT(operand2);
254 assert(PyInt_CheckExact(operand2));
256 PyTypeObject *type1 = Py_TYPE(operand1);
258 if (type1 == &PyInt_Type) {
266#pragma warning(disable : 4101)
268 NUITKA_MAY_BE_UNUSED
bool cbool_result;
269 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
270 NUITKA_MAY_BE_UNUSED
long clong_result;
271 NUITKA_MAY_BE_UNUSED
double cfloat_result;
276 CHECK_OBJECT(operand1);
277 assert(PyInt_CheckExact(operand1));
278 CHECK_OBJECT(operand2);
279 assert(PyInt_CheckExact(operand2));
281 const long a = PyInt_AS_LONG(operand1);
282 const long b = PyInt_AS_LONG(operand2);
284 if (unlikely(b == 0)) {
285 PyThreadState *tstate = PyThreadState_GET();
287 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"division by zero");
288 goto exit_result_exception;
293 goto exit_result_ok_const_float_minus_0_0;
295 goto exit_result_ok_const_float_0_0;
302#if DBL_MANT_DIG < WIDTH_OF_ULONG
303 if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
307 double r = (double)a / (
double)b;
310 goto exit_result_ok_cfloat;
314 PyObject *operand1_object = operand1;
315 PyObject *operand2_object = operand2;
317 PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
318 assert(r != Py_NotImplemented);
321 goto exit_result_object;
324 exit_result_ok_cfloat:
325 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
329 if (unlikely(obj_result == NULL)) {
330 goto exit_result_exception;
335 exit_result_ok_const_float_0_0:
336 Py_INCREF(const_float_0_0);
337 result = const_float_0_0;
340 exit_result_ok_const_float_minus_0_0:
341 Py_INCREF(const_float_minus_0_0);
342 result = const_float_minus_0_0;
348 exit_result_exception:
352 return __BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(operand1, operand2);
355PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2) {
356 return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_INT(operand1, operand2);
360#if PYTHON_VERSION < 0x300
362static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(PyObject *operand1,
363 PyObject *operand2) {
364 PyTypeObject *type2 = Py_TYPE(operand2);
368#pragma warning(disable : 4101)
370 NUITKA_MAY_BE_UNUSED
bool cbool_result;
371 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
376 binaryfunc slot1 = PyInt_Type.tp_as_number->nb_true_divide;
377 binaryfunc slot2 = NULL;
379 if (!(&PyInt_Type == type2)) {
383 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;
385 if (slot1 == slot2) {
392 if (Nuitka_Type_IsSubtype(type2, &PyInt_Type)) {
393 PyObject *x = slot2(operand1, operand2);
395 if (x != Py_NotImplemented) {
397 goto exit_binary_result_object;
400 Py_DECREF_IMMORTAL(x);
405 PyObject *x = slot1(operand1, operand2);
407 if (x != Py_NotImplemented) {
409 goto exit_binary_result_object;
412 Py_DECREF_IMMORTAL(x);
416 PyObject *x = slot2(operand1, operand2);
418 if (x != Py_NotImplemented) {
420 goto exit_binary_result_object;
423 Py_DECREF_IMMORTAL(x);
426#if PYTHON_VERSION < 0x300
427 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
428 coercion c1 = PyInt_Type.tp_as_number->nb_coerce;
431 PyObject *coerced1 = operand1;
432 PyObject *coerced2 = operand2;
434 int err = c1(&coerced1, &coerced2);
436 if (unlikely(err < 0)) {
437 goto exit_binary_exception;
441 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
443 if (likely(mv == NULL)) {
444 binaryfunc slot = mv->nb_true_divide;
446 if (likely(slot != NULL)) {
447 PyObject *x = slot(coerced1, coerced2);
453 goto exit_binary_result_object;
463 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
466 PyObject *coerced1 = operand1;
467 PyObject *coerced2 = operand2;
469 int err = c2(&coerced2, &coerced1);
471 if (unlikely(err < 0)) {
472 goto exit_binary_exception;
476 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
478 if (likely(mv == NULL)) {
479 binaryfunc slot = mv->nb_true_divide;
481 if (likely(slot != NULL)) {
482 PyObject *x = slot(coerced1, coerced2);
488 goto exit_binary_result_object;
500 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'int' and '%s'", type2->tp_name);
501 goto exit_binary_exception;
503exit_binary_result_object:
506exit_binary_exception:
509static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
510 CHECK_OBJECT(operand1);
511 assert(PyInt_CheckExact(operand1));
512 CHECK_OBJECT(operand2);
514 PyTypeObject *type2 = Py_TYPE(operand2);
516 if (&PyInt_Type == type2) {
524#pragma warning(disable : 4101)
526 NUITKA_MAY_BE_UNUSED
bool cbool_result;
527 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
528 NUITKA_MAY_BE_UNUSED
long clong_result;
529 NUITKA_MAY_BE_UNUSED
double cfloat_result;
534 CHECK_OBJECT(operand1);
535 assert(PyInt_CheckExact(operand1));
536 CHECK_OBJECT(operand2);
537 assert(PyInt_CheckExact(operand2));
539 const long a = PyInt_AS_LONG(operand1);
540 const long b = PyInt_AS_LONG(operand2);
542 if (unlikely(b == 0)) {
543 PyThreadState *tstate = PyThreadState_GET();
545 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"division by zero");
546 goto exit_result_exception;
551 goto exit_result_ok_const_float_minus_0_0;
553 goto exit_result_ok_const_float_0_0;
560#if DBL_MANT_DIG < WIDTH_OF_ULONG
561 if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
565 double r = (double)a / (
double)b;
568 goto exit_result_ok_cfloat;
572 PyObject *operand1_object = operand1;
573 PyObject *operand2_object = operand2;
575 PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
576 assert(r != Py_NotImplemented);
579 goto exit_result_object;
582 exit_result_ok_cfloat:
583 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
587 if (unlikely(obj_result == NULL)) {
588 goto exit_result_exception;
593 exit_result_ok_const_float_0_0:
594 Py_INCREF(const_float_0_0);
595 result = const_float_0_0;
598 exit_result_ok_const_float_minus_0_0:
599 Py_INCREF(const_float_minus_0_0);
600 result = const_float_minus_0_0;
606 exit_result_exception:
610 return __BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(operand1, operand2);
613PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2) {
614 return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_OBJECT(operand1, operand2);
619static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
620 CHECK_OBJECT(operand1);
621 assert(PyLong_CheckExact(operand1));
622 CHECK_OBJECT(operand2);
623 assert(PyLong_CheckExact(operand2));
630#pragma warning(disable : 4101)
632 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
633 NUITKA_MAY_BE_UNUSED
long clong_result;
638 PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(operand1, operand2);
639 assert(x != Py_NotImplemented);
642 goto exit_result_object;
645 if (unlikely(obj_result == NULL)) {
646 goto exit_result_exception;
654exit_result_exception:
658PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2) {
659 return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_LONG(operand1, operand2);
663static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(PyObject *operand1,
664 PyObject *operand2) {
665 PyTypeObject *type1 = Py_TYPE(operand1);
669#pragma warning(disable : 4101)
671 NUITKA_MAY_BE_UNUSED
bool cbool_result;
672 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
678 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;
679 binaryfunc slot2 = NULL;
681 if (!(type1 == &PyLong_Type)) {
684 slot2 = PyLong_Type.tp_as_number->nb_true_divide;
686 if (slot1 == slot2) {
692 PyObject *x = slot1(operand1, operand2);
694 if (x != Py_NotImplemented) {
696 goto exit_binary_result_object;
699 Py_DECREF_IMMORTAL(x);
703 PyObject *x = slot2(operand1, operand2);
705 if (x != Py_NotImplemented) {
707 goto exit_binary_result_object;
710 Py_DECREF_IMMORTAL(x);
713#if PYTHON_VERSION < 0x300
714 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
716 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
719 PyObject *coerced1 = operand1;
720 PyObject *coerced2 = operand2;
722 int err = c1(&coerced1, &coerced2);
724 if (unlikely(err < 0)) {
725 goto exit_binary_exception;
729 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
731 if (likely(mv == NULL)) {
732 binaryfunc slot = mv->nb_true_divide;
734 if (likely(slot != NULL)) {
735 PyObject *x = slot(coerced1, coerced2);
741 goto exit_binary_result_object;
750 coercion c2 = PyLong_Type.tp_as_number->nb_coerce;
753 PyObject *coerced1 = operand1;
754 PyObject *coerced2 = operand2;
756 int err = c2(&coerced2, &coerced1);
758 if (unlikely(err < 0)) {
759 goto exit_binary_exception;
763 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
765 if (likely(mv == NULL)) {
766 binaryfunc slot = mv->nb_true_divide;
768 if (likely(slot != NULL)) {
769 PyObject *x = slot(coerced1, coerced2);
775 goto exit_binary_result_object;
787#if PYTHON_VERSION < 0x300
788 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: '%s' and 'long'", type1->tp_name);
790 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: '%s' and 'int'", type1->tp_name);
792 goto exit_binary_exception;
794exit_binary_result_object:
797exit_binary_exception:
800static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
801 CHECK_OBJECT(operand1);
802 CHECK_OBJECT(operand2);
803 assert(PyLong_CheckExact(operand2));
805 PyTypeObject *type1 = Py_TYPE(operand1);
807 if (type1 == &PyLong_Type) {
815#pragma warning(disable : 4101)
817 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
818 NUITKA_MAY_BE_UNUSED
long clong_result;
823 PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(operand1, operand2);
824 assert(x != Py_NotImplemented);
827 goto exit_result_object;
830 if (unlikely(obj_result == NULL)) {
831 goto exit_result_exception;
839 exit_result_exception:
843 return __BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(operand1, operand2);
846PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2) {
847 return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_LONG(operand1, operand2);
851static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(PyObject *operand1,
852 PyObject *operand2) {
853 PyTypeObject *type2 = Py_TYPE(operand2);
857#pragma warning(disable : 4101)
859 NUITKA_MAY_BE_UNUSED
bool cbool_result;
860 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
865 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_true_divide;
866 binaryfunc slot2 = NULL;
868 if (!(&PyLong_Type == type2)) {
872 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;
874 if (slot1 == slot2) {
881 if (Nuitka_Type_IsSubtype(type2, &PyLong_Type)) {
882 PyObject *x = slot2(operand1, operand2);
884 if (x != Py_NotImplemented) {
886 goto exit_binary_result_object;
889 Py_DECREF_IMMORTAL(x);
894 PyObject *x = slot1(operand1, operand2);
896 if (x != Py_NotImplemented) {
898 goto exit_binary_result_object;
901 Py_DECREF_IMMORTAL(x);
905 PyObject *x = slot2(operand1, operand2);
907 if (x != Py_NotImplemented) {
909 goto exit_binary_result_object;
912 Py_DECREF_IMMORTAL(x);
915#if PYTHON_VERSION < 0x300
916 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
917 coercion c1 = PyLong_Type.tp_as_number->nb_coerce;
920 PyObject *coerced1 = operand1;
921 PyObject *coerced2 = operand2;
923 int err = c1(&coerced1, &coerced2);
925 if (unlikely(err < 0)) {
926 goto exit_binary_exception;
930 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
932 if (likely(mv == NULL)) {
933 binaryfunc slot = mv->nb_true_divide;
935 if (likely(slot != NULL)) {
936 PyObject *x = slot(coerced1, coerced2);
942 goto exit_binary_result_object;
952 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
955 PyObject *coerced1 = operand1;
956 PyObject *coerced2 = operand2;
958 int err = c2(&coerced2, &coerced1);
960 if (unlikely(err < 0)) {
961 goto exit_binary_exception;
965 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
967 if (likely(mv == NULL)) {
968 binaryfunc slot = mv->nb_true_divide;
970 if (likely(slot != NULL)) {
971 PyObject *x = slot(coerced1, coerced2);
977 goto exit_binary_result_object;
989#if PYTHON_VERSION < 0x300
990 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'long' and '%s'", type2->tp_name);
992 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'int' and '%s'", type2->tp_name);
994 goto exit_binary_exception;
996exit_binary_result_object:
999exit_binary_exception:
1002static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
1003 CHECK_OBJECT(operand1);
1004 assert(PyLong_CheckExact(operand1));
1005 CHECK_OBJECT(operand2);
1007 PyTypeObject *type2 = Py_TYPE(operand2);
1009 if (&PyLong_Type == type2) {
1015#if defined(_MSC_VER)
1016#pragma warning(push)
1017#pragma warning(disable : 4101)
1019 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1020 NUITKA_MAY_BE_UNUSED
long clong_result;
1021#if defined(_MSC_VER)
1025 PyObject *x = PyLong_Type.tp_as_number->nb_true_divide(operand1, operand2);
1026 assert(x != Py_NotImplemented);
1029 goto exit_result_object;
1032 if (unlikely(obj_result == NULL)) {
1033 goto exit_result_exception;
1035 result = obj_result;
1036 goto exit_result_ok;
1041 exit_result_exception:
1045 return __BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(operand1, operand2);
1048PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2) {
1049 return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_OBJECT(operand1, operand2);
1053static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
1054 CHECK_OBJECT(operand1);
1055 assert(PyFloat_CheckExact(operand1));
1056 CHECK_OBJECT(operand2);
1057 assert(PyFloat_CheckExact(operand2));
1061#if defined(_MSC_VER)
1062#pragma warning(push)
1063#pragma warning(disable : 4101)
1066 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1067 NUITKA_MAY_BE_UNUSED
long clong_result;
1068 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1069#if defined(_MSC_VER)
1073 CHECK_OBJECT(operand1);
1074 assert(PyFloat_CheckExact(operand1));
1075 CHECK_OBJECT(operand2);
1076 assert(PyFloat_CheckExact(operand2));
1078 const double a = PyFloat_AS_DOUBLE(operand1);
1079 const double b = PyFloat_AS_DOUBLE(operand2);
1081 if (unlikely(b == 0.0)) {
1082 PyThreadState *tstate = PyThreadState_GET();
1084 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float division by zero");
1085 goto exit_result_exception;
1092 goto exit_result_ok_cfloat;
1095exit_result_ok_cfloat:
1096 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
1097 goto exit_result_ok;
1102exit_result_exception:
1106PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2) {
1107 return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_FLOAT(operand1, operand2);
1111static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1,
1112 PyObject *operand2) {
1113 PyTypeObject *type1 = Py_TYPE(operand1);
1115#if defined(_MSC_VER)
1116#pragma warning(push)
1117#pragma warning(disable : 4101)
1119 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1120 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1121#if defined(_MSC_VER)
1126 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;
1127 binaryfunc slot2 = NULL;
1129 if (!(type1 == &PyFloat_Type)) {
1132 slot2 = PyFloat_Type.tp_as_number->nb_true_divide;
1134 if (slot1 == slot2) {
1139 if (slot1 != NULL) {
1140 PyObject *x = slot1(operand1, operand2);
1142 if (x != Py_NotImplemented) {
1144 goto exit_binary_result_object;
1147 Py_DECREF_IMMORTAL(x);
1150 if (slot2 != NULL) {
1151 PyObject *x = slot2(operand1, operand2);
1153 if (x != Py_NotImplemented) {
1155 goto exit_binary_result_object;
1158 Py_DECREF_IMMORTAL(x);
1161#if PYTHON_VERSION < 0x300
1162 if (!NEW_STYLE_NUMBER_TYPE(type1) || !1) {
1164 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
1167 PyObject *coerced1 = operand1;
1168 PyObject *coerced2 = operand2;
1170 int err = c1(&coerced1, &coerced2);
1172 if (unlikely(err < 0)) {
1173 goto exit_binary_exception;
1177 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1179 if (likely(mv == NULL)) {
1180 binaryfunc slot = mv->nb_true_divide;
1182 if (likely(slot != NULL)) {
1183 PyObject *x = slot(coerced1, coerced2);
1185 Py_DECREF(coerced1);
1186 Py_DECREF(coerced2);
1189 goto exit_binary_result_object;
1194 Py_DECREF(coerced1);
1195 Py_DECREF(coerced2);
1198 coercion c2 = PyFloat_Type.tp_as_number->nb_coerce;
1201 PyObject *coerced1 = operand1;
1202 PyObject *coerced2 = operand2;
1204 int err = c2(&coerced2, &coerced1);
1206 if (unlikely(err < 0)) {
1207 goto exit_binary_exception;
1211 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1213 if (likely(mv == NULL)) {
1214 binaryfunc slot = mv->nb_true_divide;
1216 if (likely(slot != NULL)) {
1217 PyObject *x = slot(coerced1, coerced2);
1219 Py_DECREF(coerced1);
1220 Py_DECREF(coerced2);
1223 goto exit_binary_result_object;
1228 Py_DECREF(coerced1);
1229 Py_DECREF(coerced2);
1235 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: '%s' and 'float'", type1->tp_name);
1236 goto exit_binary_exception;
1238exit_binary_result_object:
1241exit_binary_exception:
1244static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
1245 CHECK_OBJECT(operand1);
1246 CHECK_OBJECT(operand2);
1247 assert(PyFloat_CheckExact(operand2));
1249 PyTypeObject *type1 = Py_TYPE(operand1);
1251 if (type1 == &PyFloat_Type) {
1256#if defined(_MSC_VER)
1257#pragma warning(push)
1258#pragma warning(disable : 4101)
1261 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1262 NUITKA_MAY_BE_UNUSED
long clong_result;
1263 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1264#if defined(_MSC_VER)
1268 CHECK_OBJECT(operand1);
1269 assert(PyFloat_CheckExact(operand1));
1270 CHECK_OBJECT(operand2);
1271 assert(PyFloat_CheckExact(operand2));
1273 const double a = PyFloat_AS_DOUBLE(operand1);
1274 const double b = PyFloat_AS_DOUBLE(operand2);
1276 if (unlikely(b == 0.0)) {
1277 PyThreadState *tstate = PyThreadState_GET();
1279 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float division by zero");
1280 goto exit_result_exception;
1287 goto exit_result_ok_cfloat;
1290 exit_result_ok_cfloat:
1291 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
1292 goto exit_result_ok;
1297 exit_result_exception:
1301 return __BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(operand1, operand2);
1304PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2) {
1305 return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_FLOAT(operand1, operand2);
1309static HEDLEY_NEVER_INLINE PyObject *__BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1,
1310 PyObject *operand2) {
1311 PyTypeObject *type2 = Py_TYPE(operand2);
1313#if defined(_MSC_VER)
1314#pragma warning(push)
1315#pragma warning(disable : 4101)
1317 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1318 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1319#if defined(_MSC_VER)
1323 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;
1324 binaryfunc slot2 = NULL;
1326 if (!(&PyFloat_Type == type2)) {
1330 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;
1332 if (slot1 == slot2) {
1337 if (slot1 != NULL) {
1338 if (slot2 != NULL) {
1339 if (Nuitka_Type_IsSubtype(type2, &PyFloat_Type)) {
1340 PyObject *x = slot2(operand1, operand2);
1342 if (x != Py_NotImplemented) {
1344 goto exit_binary_result_object;
1347 Py_DECREF_IMMORTAL(x);
1352 PyObject *x = slot1(operand1, operand2);
1354 if (x != Py_NotImplemented) {
1356 goto exit_binary_result_object;
1359 Py_DECREF_IMMORTAL(x);
1362 if (slot2 != NULL) {
1363 PyObject *x = slot2(operand1, operand2);
1365 if (x != Py_NotImplemented) {
1367 goto exit_binary_result_object;
1370 Py_DECREF_IMMORTAL(x);
1373#if PYTHON_VERSION < 0x300
1374 if (!1 || !NEW_STYLE_NUMBER_TYPE(type2)) {
1375 coercion c1 = PyFloat_Type.tp_as_number->nb_coerce;
1378 PyObject *coerced1 = operand1;
1379 PyObject *coerced2 = operand2;
1381 int err = c1(&coerced1, &coerced2);
1383 if (unlikely(err < 0)) {
1384 goto exit_binary_exception;
1388 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1390 if (likely(mv == NULL)) {
1391 binaryfunc slot = mv->nb_true_divide;
1393 if (likely(slot != NULL)) {
1394 PyObject *x = slot(coerced1, coerced2);
1396 Py_DECREF(coerced1);
1397 Py_DECREF(coerced2);
1400 goto exit_binary_result_object;
1405 Py_DECREF(coerced1);
1406 Py_DECREF(coerced2);
1410 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
1413 PyObject *coerced1 = operand1;
1414 PyObject *coerced2 = operand2;
1416 int err = c2(&coerced2, &coerced1);
1418 if (unlikely(err < 0)) {
1419 goto exit_binary_exception;
1423 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
1425 if (likely(mv == NULL)) {
1426 binaryfunc slot = mv->nb_true_divide;
1428 if (likely(slot != NULL)) {
1429 PyObject *x = slot(coerced1, coerced2);
1431 Py_DECREF(coerced1);
1432 Py_DECREF(coerced2);
1435 goto exit_binary_result_object;
1440 Py_DECREF(coerced1);
1441 Py_DECREF(coerced2);
1447 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'float' and '%s'", type2->tp_name);
1448 goto exit_binary_exception;
1450exit_binary_result_object:
1453exit_binary_exception:
1456static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
1457 CHECK_OBJECT(operand1);
1458 assert(PyFloat_CheckExact(operand1));
1459 CHECK_OBJECT(operand2);
1461 PyTypeObject *type2 = Py_TYPE(operand2);
1463 if (&PyFloat_Type == type2) {
1468#if defined(_MSC_VER)
1469#pragma warning(push)
1470#pragma warning(disable : 4101)
1473 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1474 NUITKA_MAY_BE_UNUSED
long clong_result;
1475 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1476#if defined(_MSC_VER)
1480 CHECK_OBJECT(operand1);
1481 assert(PyFloat_CheckExact(operand1));
1482 CHECK_OBJECT(operand2);
1483 assert(PyFloat_CheckExact(operand2));
1485 const double a = PyFloat_AS_DOUBLE(operand1);
1486 const double b = PyFloat_AS_DOUBLE(operand2);
1488 if (unlikely(b == 0.0)) {
1489 PyThreadState *tstate = PyThreadState_GET();
1491 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float division by zero");
1492 goto exit_result_exception;
1499 goto exit_result_ok_cfloat;
1502 exit_result_ok_cfloat:
1503 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
1504 goto exit_result_ok;
1509 exit_result_exception:
1513 return __BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(operand1, operand2);
1516PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2) {
1517 return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_OBJECT(operand1, operand2);
1521static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
1522 CHECK_OBJECT(operand1);
1523 assert(PyFloat_CheckExact(operand1));
1524 CHECK_OBJECT(operand2);
1525 assert(PyLong_CheckExact(operand2));
1527#if defined(_MSC_VER)
1528#pragma warning(push)
1529#pragma warning(disable : 4101)
1531 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1532 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1533#if defined(_MSC_VER)
1537 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;
1540 if (slot1 != NULL) {
1541 PyObject *x = slot1(operand1, operand2);
1543 if (x != Py_NotImplemented) {
1545 goto exit_binary_result_object;
1548 Py_DECREF_IMMORTAL(x);
1553#if PYTHON_VERSION < 0x300
1554 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'float' and 'long'");
1556 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'float' and 'int'");
1558 goto exit_binary_exception;
1560exit_binary_result_object:
1563exit_binary_exception:
1567PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2) {
1568 return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_LONG(operand1, operand2);
1572static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {
1573 CHECK_OBJECT(operand1);
1574 assert(PyLong_CheckExact(operand1));
1575 CHECK_OBJECT(operand2);
1576 assert(PyFloat_CheckExact(operand2));
1578#if defined(_MSC_VER)
1579#pragma warning(push)
1580#pragma warning(disable : 4101)
1582 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1583 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1584#if defined(_MSC_VER)
1589 binaryfunc slot2 = NULL;
1594 slot2 = PyFloat_Type.tp_as_number->nb_true_divide;
1597 if (slot2 != NULL) {
1598 PyObject *x = slot2(operand1, operand2);
1600 if (x != Py_NotImplemented) {
1602 goto exit_binary_result_object;
1605 Py_DECREF_IMMORTAL(x);
1610#if PYTHON_VERSION < 0x300
1611 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'long' and 'float'");
1613 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'int' and 'float'");
1615 goto exit_binary_exception;
1617exit_binary_result_object:
1620exit_binary_exception:
1624PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2) {
1625 return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_FLOAT(operand1, operand2);
1628#if PYTHON_VERSION < 0x300
1630static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
1631 CHECK_OBJECT(operand1);
1632 assert(PyFloat_CheckExact(operand1));
1633 CHECK_OBJECT(operand2);
1634 assert(PyInt_CheckExact(operand2));
1636#if defined(_MSC_VER)
1637#pragma warning(push)
1638#pragma warning(disable : 4101)
1640 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1641 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1642#if defined(_MSC_VER)
1646 binaryfunc slot1 = PyFloat_Type.tp_as_number->nb_true_divide;
1649 if (slot1 != NULL) {
1650 PyObject *x = slot1(operand1, operand2);
1652 if (x != Py_NotImplemented) {
1654 goto exit_binary_result_object;
1657 Py_DECREF_IMMORTAL(x);
1662 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'float' and 'int'");
1663 goto exit_binary_exception;
1665exit_binary_result_object:
1668exit_binary_exception:
1672PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2) {
1673 return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_INT(operand1, operand2);
1677#if PYTHON_VERSION < 0x300
1679static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {
1680 CHECK_OBJECT(operand1);
1681 assert(PyInt_CheckExact(operand1));
1682 CHECK_OBJECT(operand2);
1683 assert(PyFloat_CheckExact(operand2));
1685#if defined(_MSC_VER)
1686#pragma warning(push)
1687#pragma warning(disable : 4101)
1689 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1690 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1691#if defined(_MSC_VER)
1696 binaryfunc slot2 = NULL;
1701 slot2 = PyFloat_Type.tp_as_number->nb_true_divide;
1704 if (slot2 != NULL) {
1705 PyObject *x = slot2(operand1, operand2);
1707 if (x != Py_NotImplemented) {
1709 goto exit_binary_result_object;
1712 Py_DECREF_IMMORTAL(x);
1717 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'int' and 'float'");
1718 goto exit_binary_exception;
1720exit_binary_result_object:
1723exit_binary_exception:
1727PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2) {
1728 return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_FLOAT(operand1, operand2);
1732#if PYTHON_VERSION < 0x300
1734static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
1735 CHECK_OBJECT(operand1);
1736 assert(PyLong_CheckExact(operand1));
1737 CHECK_OBJECT(operand2);
1738 assert(PyInt_CheckExact(operand2));
1740#if defined(_MSC_VER)
1741#pragma warning(push)
1742#pragma warning(disable : 4101)
1744 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1745 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1746#if defined(_MSC_VER)
1750 binaryfunc slot1 = PyLong_Type.tp_as_number->nb_true_divide;
1753 if (slot1 != NULL) {
1754 PyObject *x = slot1(operand1, operand2);
1756 if (x != Py_NotImplemented) {
1758 goto exit_binary_result_object;
1761 Py_DECREF_IMMORTAL(x);
1766 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'long' and 'int'");
1767 goto exit_binary_exception;
1769exit_binary_result_object:
1772exit_binary_exception:
1776PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2) {
1777 return _BINARY_OPERATION_TRUEDIV_OBJECT_LONG_INT(operand1, operand2);
1781#if PYTHON_VERSION < 0x300
1783static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {
1784 CHECK_OBJECT(operand1);
1785 assert(PyInt_CheckExact(operand1));
1786 CHECK_OBJECT(operand2);
1787 assert(PyLong_CheckExact(operand2));
1789#if defined(_MSC_VER)
1790#pragma warning(push)
1791#pragma warning(disable : 4101)
1793 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1794 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1795#if defined(_MSC_VER)
1800 binaryfunc slot2 = NULL;
1805 slot2 = PyLong_Type.tp_as_number->nb_true_divide;
1808 if (slot2 != NULL) {
1809 PyObject *x = slot2(operand1, operand2);
1811 if (x != Py_NotImplemented) {
1813 goto exit_binary_result_object;
1816 Py_DECREF_IMMORTAL(x);
1821 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: 'int' and 'long'");
1822 goto exit_binary_exception;
1824exit_binary_result_object:
1827exit_binary_exception:
1831PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2) {
1832 return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_LONG(operand1, operand2);
1836#if PYTHON_VERSION < 0x300
1838static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_INT_CLONG(PyObject *operand1,
long operand2) {
1839 CHECK_OBJECT(operand1);
1840 assert(PyInt_CheckExact(operand1));
1845#if defined(_MSC_VER)
1846#pragma warning(push)
1847#pragma warning(disable : 4101)
1849 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1850 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1851 NUITKA_MAY_BE_UNUSED
long clong_result;
1852 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1853#if defined(_MSC_VER)
1857 CHECK_OBJECT(operand1);
1858 assert(PyInt_CheckExact(operand1));
1860 const long a = PyInt_AS_LONG(operand1);
1861 const long b = operand2;
1863 if (unlikely(b == 0)) {
1864 PyThreadState *tstate = PyThreadState_GET();
1866 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"division by zero");
1867 goto exit_result_exception;
1872 goto exit_result_ok_const_float_minus_0_0;
1874 goto exit_result_ok_const_float_0_0;
1881#if DBL_MANT_DIG < WIDTH_OF_ULONG
1882 if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
1886 double r = (double)a / (
double)b;
1889 goto exit_result_ok_cfloat;
1893 PyObject *operand1_object = operand1;
1894 PyObject *operand2_object = Nuitka_PyLong_FromLong(operand2);
1896 PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
1897 assert(r != Py_NotImplemented);
1899 Py_DECREF(operand2_object);
1902 goto exit_result_object;
1905exit_result_ok_cfloat:
1906 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
1907 goto exit_result_ok;
1910 if (unlikely(obj_result == NULL)) {
1911 goto exit_result_exception;
1913 result = obj_result;
1914 goto exit_result_ok;
1916exit_result_ok_const_float_0_0:
1917 Py_INCREF(const_float_0_0);
1918 result = const_float_0_0;
1919 goto exit_result_ok;
1921exit_result_ok_const_float_minus_0_0:
1922 Py_INCREF(const_float_minus_0_0);
1923 result = const_float_minus_0_0;
1924 goto exit_result_ok;
1929exit_result_exception:
1933PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_INT_CLONG(PyObject *operand1,
long operand2) {
1934 return _BINARY_OPERATION_TRUEDIV_OBJECT_INT_CLONG(operand1, operand2);
1938#if PYTHON_VERSION < 0x300
1940static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_CLONG_INT(
long operand1, PyObject *operand2) {
1942 CHECK_OBJECT(operand2);
1943 assert(PyInt_CheckExact(operand2));
1948#if defined(_MSC_VER)
1949#pragma warning(push)
1950#pragma warning(disable : 4101)
1952 NUITKA_MAY_BE_UNUSED
bool cbool_result;
1953 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
1954 NUITKA_MAY_BE_UNUSED
long clong_result;
1955 NUITKA_MAY_BE_UNUSED
double cfloat_result;
1956#if defined(_MSC_VER)
1960 CHECK_OBJECT(operand2);
1961 assert(PyInt_CheckExact(operand2));
1963 const long a = operand1;
1964 const long b = PyInt_AS_LONG(operand2);
1966 if (unlikely(b == 0)) {
1967 PyThreadState *tstate = PyThreadState_GET();
1969 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"division by zero");
1970 goto exit_result_exception;
1975 goto exit_result_ok_const_float_minus_0_0;
1977 goto exit_result_ok_const_float_0_0;
1984#if DBL_MANT_DIG < WIDTH_OF_ULONG
1985 if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
1989 double r = (double)a / (
double)b;
1992 goto exit_result_ok_cfloat;
1996 PyObject *operand1_object = Nuitka_PyLong_FromLong(operand1);
1997 PyObject *operand2_object = operand2;
1999 PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
2000 assert(r != Py_NotImplemented);
2002 Py_DECREF(operand1_object);
2005 goto exit_result_object;
2008exit_result_ok_cfloat:
2009 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
2010 goto exit_result_ok;
2013 if (unlikely(obj_result == NULL)) {
2014 goto exit_result_exception;
2016 result = obj_result;
2017 goto exit_result_ok;
2019exit_result_ok_const_float_0_0:
2020 Py_INCREF(const_float_0_0);
2021 result = const_float_0_0;
2022 goto exit_result_ok;
2024exit_result_ok_const_float_minus_0_0:
2025 Py_INCREF(const_float_minus_0_0);
2026 result = const_float_minus_0_0;
2027 goto exit_result_ok;
2032exit_result_exception:
2036PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_CLONG_INT(
long operand1, PyObject *operand2) {
2037 return _BINARY_OPERATION_TRUEDIV_OBJECT_CLONG_INT(operand1, operand2);
2042static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1,
double operand2) {
2043 CHECK_OBJECT(operand1);
2044 assert(PyFloat_CheckExact(operand1));
2048#if defined(_MSC_VER)
2049#pragma warning(push)
2050#pragma warning(disable : 4101)
2053 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2054 NUITKA_MAY_BE_UNUSED
long clong_result;
2055 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2056#if defined(_MSC_VER)
2060 CHECK_OBJECT(operand1);
2061 assert(PyFloat_CheckExact(operand1));
2063 const double a = PyFloat_AS_DOUBLE(operand1);
2064 const double b = operand2;
2066 if (unlikely(b == 0.0)) {
2067 PyThreadState *tstate = PyThreadState_GET();
2069 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float division by zero");
2070 goto exit_result_exception;
2077 goto exit_result_ok_cfloat;
2080exit_result_ok_cfloat:
2081 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
2082 goto exit_result_ok;
2087exit_result_exception:
2091PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_CFLOAT(PyObject *operand1,
double operand2) {
2092 return _BINARY_OPERATION_TRUEDIV_OBJECT_FLOAT_CFLOAT(operand1, operand2);
2096static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_CFLOAT_FLOAT(
double operand1, PyObject *operand2) {
2098 CHECK_OBJECT(operand2);
2099 assert(PyFloat_CheckExact(operand2));
2103#if defined(_MSC_VER)
2104#pragma warning(push)
2105#pragma warning(disable : 4101)
2108 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2109 NUITKA_MAY_BE_UNUSED
long clong_result;
2110 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2111#if defined(_MSC_VER)
2115 CHECK_OBJECT(operand2);
2116 assert(PyFloat_CheckExact(operand2));
2118 const double a = operand1;
2119 const double b = PyFloat_AS_DOUBLE(operand2);
2121 if (unlikely(b == 0.0)) {
2122 PyThreadState *tstate = PyThreadState_GET();
2124 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"float division by zero");
2125 goto exit_result_exception;
2132 goto exit_result_ok_cfloat;
2135exit_result_ok_cfloat:
2136 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
2137 goto exit_result_ok;
2142exit_result_exception:
2146PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_CFLOAT_FLOAT(
double operand1, PyObject *operand2) {
2147 return _BINARY_OPERATION_TRUEDIV_OBJECT_CFLOAT_FLOAT(operand1, operand2);
2151static PyObject *_BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
2152 CHECK_OBJECT(operand1);
2153 CHECK_OBJECT(operand2);
2155#if PYTHON_VERSION < 0x300
2156 if (PyInt_CheckExact(operand1) && PyInt_CheckExact(operand2)) {
2160#if defined(_MSC_VER)
2161#pragma warning(push)
2162#pragma warning(disable : 4101)
2164 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2165 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2166 NUITKA_MAY_BE_UNUSED
long clong_result;
2167 NUITKA_MAY_BE_UNUSED
double cfloat_result;
2168#if defined(_MSC_VER)
2172 CHECK_OBJECT(operand1);
2173 assert(PyInt_CheckExact(operand1));
2174 CHECK_OBJECT(operand2);
2175 assert(PyInt_CheckExact(operand2));
2177 const long a = PyInt_AS_LONG(operand1);
2178 const long b = PyInt_AS_LONG(operand2);
2180 if (unlikely(b == 0)) {
2181 PyThreadState *tstate = PyThreadState_GET();
2183 SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_ZeroDivisionError,
"division by zero");
2184 goto exit_result_exception;
2189 goto exit_result_ok_const_float_minus_0_0;
2191 goto exit_result_ok_const_float_0_0;
2198#if DBL_MANT_DIG < WIDTH_OF_ULONG
2199 if ((a >= 0 ? 0UL + a : 0UL - a) >> DBL_MANT_DIG || (b >= 0 ? 0UL + b : 0UL - b) >> DBL_MANT_DIG) {
2203 double r = (double)a / (
double)b;
2206 goto exit_result_ok_cfloat;
2210 PyObject *operand1_object = operand1;
2211 PyObject *operand2_object = operand2;
2213 PyObject *r = PyLong_Type.tp_as_number->nb_true_divide(operand1_object, operand2_object);
2214 assert(r != Py_NotImplemented);
2217 goto exit_result_object;
2220 exit_result_ok_cfloat:
2221 result = MAKE_FLOAT_FROM_DOUBLE(cfloat_result);
2222 goto exit_result_ok;
2225 if (unlikely(obj_result == NULL)) {
2226 goto exit_result_exception;
2228 result = obj_result;
2229 goto exit_result_ok;
2231 exit_result_ok_const_float_0_0:
2232 Py_INCREF(const_float_0_0);
2233 result = const_float_0_0;
2234 goto exit_result_ok;
2236 exit_result_ok_const_float_minus_0_0:
2237 Py_INCREF(const_float_minus_0_0);
2238 result = const_float_minus_0_0;
2239 goto exit_result_ok;
2244 exit_result_exception:
2249 PyTypeObject *type1 = Py_TYPE(operand1);
2250 PyTypeObject *type2 = Py_TYPE(operand2);
2252#if defined(_MSC_VER)
2253#pragma warning(push)
2254#pragma warning(disable : 4101)
2256 NUITKA_MAY_BE_UNUSED
bool cbool_result;
2257 NUITKA_MAY_BE_UNUSED PyObject *obj_result;
2258#if defined(_MSC_VER)
2263 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_true_divide : NULL;
2264 binaryfunc slot2 = NULL;
2266 if (!(type1 == type2)) {
2270 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_true_divide : NULL;
2272 if (slot1 == slot2) {
2277 if (slot1 != NULL) {
2278 if (slot2 != NULL) {
2279 if (Nuitka_Type_IsSubtype(type2, type1)) {
2280 PyObject *x = slot2(operand1, operand2);
2282 if (x != Py_NotImplemented) {
2284 goto exit_binary_result_object;
2287 Py_DECREF_IMMORTAL(x);
2292 PyObject *x = slot1(operand1, operand2);
2294 if (x != Py_NotImplemented) {
2296 goto exit_binary_result_object;
2299 Py_DECREF_IMMORTAL(x);
2302 if (slot2 != NULL) {
2303 PyObject *x = slot2(operand1, operand2);
2305 if (x != Py_NotImplemented) {
2307 goto exit_binary_result_object;
2310 Py_DECREF_IMMORTAL(x);
2313#if PYTHON_VERSION < 0x300
2314 if (!NEW_STYLE_NUMBER_TYPE(type1) || !NEW_STYLE_NUMBER_TYPE(type2)) {
2316 (type1->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type1)) ? type1->tp_as_number->nb_coerce : NULL;
2319 PyObject *coerced1 = operand1;
2320 PyObject *coerced2 = operand2;
2322 int err = c1(&coerced1, &coerced2);
2324 if (unlikely(err < 0)) {
2325 goto exit_binary_exception;
2329 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2331 if (likely(mv == NULL)) {
2332 binaryfunc slot = mv->nb_true_divide;
2334 if (likely(slot != NULL)) {
2335 PyObject *x = slot(coerced1, coerced2);
2337 Py_DECREF(coerced1);
2338 Py_DECREF(coerced2);
2341 goto exit_binary_result_object;
2346 Py_DECREF(coerced1);
2347 Py_DECREF(coerced2);
2351 (type2->tp_as_number != NULL && NEW_STYLE_NUMBER_TYPE(type2)) ? type2->tp_as_number->nb_coerce : NULL;
2354 PyObject *coerced1 = operand1;
2355 PyObject *coerced2 = operand2;
2357 int err = c2(&coerced2, &coerced1);
2359 if (unlikely(err < 0)) {
2360 goto exit_binary_exception;
2364 PyNumberMethods *mv = Py_TYPE(coerced1)->tp_as_number;
2366 if (likely(mv == NULL)) {
2367 binaryfunc slot = mv->nb_true_divide;
2369 if (likely(slot != NULL)) {
2370 PyObject *x = slot(coerced1, coerced2);
2372 Py_DECREF(coerced1);
2373 Py_DECREF(coerced2);
2376 goto exit_binary_result_object;
2381 Py_DECREF(coerced1);
2382 Py_DECREF(coerced2);
2388 PyErr_Format(PyExc_TypeError,
"unsupported operand type(s) for /: '%s' and '%s'", type1->tp_name, type2->tp_name);
2389 goto exit_binary_exception;
2391exit_binary_result_object:
2394exit_binary_exception:
2398PyObject *BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2) {
2399 return _BINARY_OPERATION_TRUEDIV_OBJECT_OBJECT_OBJECT(operand1, operand2);